(ref #215) fix libedit include pathes

This commit is contained in:
Sunrim KIM (keen) 2014-09-20 16:30:26 +09:00
parent 9b226afd1f
commit 90542fad8b
2 changed files with 7 additions and 12 deletions

View File

@ -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)

View File

@ -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)