summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBaruch Sterin <baruchs@gmail.com>2015-11-05 01:23:35 -0800
committerBaruch Sterin <baruchs@gmail.com>2015-11-05 01:23:35 -0800
commit0f14713dbc4e68f5b87e0cac99c44db97d58f666 (patch)
tree94d59996ec18e2a9c71ab0307b0752a41a95a53d /CMakeLists.txt
parent0f4fc1caa2f281f03409789124f87cbd71e8fd9c (diff)
downloadabc-0f14713dbc4e68f5b87e0cac99c44db97d58f666.tar.gz
abc-0f14713dbc4e68f5b87e0cac99c44db97d58f666.tar.bz2
abc-0f14713dbc4e68f5b87e0cac99c44db97d58f666.zip
CMakeLists.txt, Makefile: pass readline flags from the CMake lists file to the Makefile.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 40f2bbb7..d57dd032 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,10 +25,19 @@ endfunction()
project(abc)
+if(READLINE_FOUND MATCHES TRUE)
+ addprefix(READLINE_INCLUDES_FLAGS "-I" ${READLINE_INCLUDES})
+ list(APPEND ABC_READLINE_FLAGS "ABC_READLINE_INCLUDES=${READLINE_INCLUDES_FLAGS}")
+ list(APPEND ABC_READLINE_FLAGS "ABC_READLINE_LIBRARIES=${READLINE_LIBRARIES}")
+elseif(READLINE_FOUND MATCHES FALSE)
+ list(APPEND ABC_READLINE_FLAGS "ABC_USE_NO_READLINE=1")
+endif()
+
# run make to extract compiler options, linker options and list of source files
execute_process(
COMMAND
make
+ ${ABC_READLINE_FLAGS}
ABC_MAKE_NO_DEPS=1
CC=${CMAKE_C_COMPILER}
CXX=${CMAKE_CXX_COMPILER}