summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt16
-rw-r--r--Makefile7
2 files changed, 13 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c829f4a2..f07fe7d2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,6 +4,13 @@ include(CMakeParseArguments)
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
+function(addprefix var prefix)
+ foreach( s ${ARGN} )
+ list(APPEND tmp "-I${s}")
+ endforeach()
+ set(${var} ${tmp} PARENT_SCOPE)
+endfunction()
+
# filter out flags that are not appropriate for the compiler being used
function(target_compile_options_filtered target visibility)
foreach( flag ${ARGN} )
@@ -26,9 +33,12 @@ 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}")
+ addprefix(ABC_READLINE_INCLUDES_FLAGS "-I" ${READLINE_INCLUDES})
+ string(REPLACE ";" " " ABC_READLINE_INCLUDES_FLAGS "${ABC_READLINE_INCLUDES_FLAGS}")
+ list(APPEND ABC_READLINE_FLAGS "ABC_READLINE_INCLUDES=${ABC_READLINE_INCLUDES_FLAGS}")
+
+ string(REPLACE ";" " " ABC_READLINE_LIBRARIES_FLAGS "${READLINE_LIBRARIES}")
+ list(APPEND ABC_READLINE_FLAGS "ABC_READLINE_LIBRARIES=${ABC_READLINE_LIBRARIES_FLAGS}")
elseif(READLINE_FOUND MATCHES FALSE)
list(APPEND ABC_READLINE_FLAGS "ABC_USE_NO_READLINE=1")
endif()
diff --git a/Makefile b/Makefile
index cd1d0edd..4b5190d0 100644
--- a/Makefile
+++ b/Makefile
@@ -73,13 +73,6 @@ ifndef ABC_USE_NO_READLINE
$(info $(MSG_PREFIX)Using libreadline)
endif
-# whether to use libreadline
-ifndef ABC_USE_NO_READLINE
- CFLAGS += -DABC_USE_READLINE
- LIBS += -lreadline
- $(info $(MSG_PREFIX)Using libreadline)
-endif
-
# whether to compile with thread support
ifdef ABC_USE_NO_PTHREADS
CFLAGS += -DABC_USE_PTHREADS