diff --git a/contrib/10.readline/CMakeLists.txt b/contrib/10.readline/CMakeLists.txt index 6a8b4fd8..413e8c19 100644 --- a/contrib/10.readline/CMakeLists.txt +++ b/contrib/10.readline/CMakeLists.txt @@ -4,8 +4,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/contrib/10.rea find_package(Libedit) if (Libedit_FOUND) - add_definitions(${Libedit_DEFINITIONS} -DPIC_READLINE_FOUND=1) - add_definitions(${Libedit_DEFINITIONS} -DPIC_READLINE_INCLUDE_DIR_SUFFIX=${Libedit_INCLUDE_DIR_SUFFIX}) + add_definitions(${Libedit_DEFINITIONS} -DPIC_READLINE_FOUND=1 -DPIC_READLINE_INCLUDE_DIR_SUFFIX=${Libedit_INCLUDE_DIR_SUFFIX}) include_directories(${Libedit_INCLUDE_DIR}) file(GLOB PICRIN_READLINE_SOURCES ${PROJECT_SOURCE_DIR}/contrib/10.readline/src/*.c) @@ -15,4 +14,4 @@ if (Libedit_FOUND) list(APPEND PICRIN_CONTRIB_SOURCES ${PICRIN_READLINE_SOURCES}) add_custom_target(test-readline for test in ${PROJECT_SOURCE_DIR}/contrib/10.readline/t/*.scm \; do bin/picrin "$$test" \; done DEPENDS repl) set(CONTRIB_TESTS ${CONTRIB_TESTS} test-readline) -endif() +endif(Libedit_FOUND) diff --git a/contrib/10.readline/cmake/FindLibedit.cmake b/contrib/10.readline/cmake/FindLibedit.cmake index b24432ff..9a771988 100644 --- a/contrib/10.readline/cmake/FindLibedit.cmake +++ b/contrib/10.readline/cmake/FindLibedit.cmake @@ -32,16 +32,14 @@ else (Libedit_LIBRARIES AND Libedit_INCLUDE_DIRS) endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) find_path(Libedit_EDITLINE_INCLUDE_DIR NAMES - readline.h - history.h + editline/readline.h + editline/history.h PATHS ${_Libedit_INCLUDEDIR} /usr/include /usr/local/include /opt/local/include /sw/include - PATH_SUFFIXES - editline ) if (Libedit_EDITLINE_INCLUDE_DIR) set(Libedit_INCLUDE_DIR_SUFFIX editline) @@ -49,15 +47,13 @@ else (Libedit_LIBRARIES AND Libedit_INCLUDE_DIRS) else (Libedit_EDITLINE_INCLUDE_DIR) find_path(Libedit_READLINE_INCLUDE_DIR NAMES - readline.h - history.h + readline/readline.h + readline/history.h PATHS /usr/include/edit /usr/local/include/edit /opt/local/include/edit /sw/include/edit - PATH_SUFFIXES - readline ) if (Libedit_READLINE_INCLUDE_DIR) set(Libedit_INCLUDE_DIR_SUFFIX readline) @@ -97,7 +93,7 @@ else (Libedit_LIBRARIES AND Libedit_INCLUDE_DIRS) if (Libedit_FOUND) if (NOT Libedit_FIND_QUIETLY) - message(STATUS "Found libedit: ${Libedit_LIBRARY}") + message(STATUS "Found libedit: ${Libedit_LIBRARY}, ${Libedit_INCLUDE_DIR}") endif (NOT Libedit_FIND_QUIETLY) else (Libedit_FOUND) if (Libedit_FIND_REQUIRED)