picrin/contrib/10.readline/CMakeLists.txt

20 lines
747 B
CMake

# readline
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/contrib/10.readline/cmake/")
find_package(Libedit)
find_package(Libedit)
if (Libedit_FOUND)
add_definitions(${Libedit_DEFINITIONS} -DPIC_READLINE_FOUND=1)
include_directories(${Libedit_INCLUDE_DIR})
file(GLOB PICRIN_READLINE_SOURCES ${PROJECT_SOURCE_DIR}/contrib/10.readline/src/*.c)
list(APPEND PICRIN_CONTRIB_INITS readline)
list(APPEND PICRIN_CONTRIB_LIBRARIES ${Libedit_LIBRARIES})
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()