summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt24
1 files changed, 17 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 712aa714..ab17cedd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,12 +19,10 @@ set(Ledger_TEST_TIMEZONE "America/Chicago")
enable_testing()
-add_definitions(
- -std=c++11
- -DBOOST_FILESYSTEM_NO_DEPRECATED
-)
+add_compile_definitions(BOOST_FILESYSTEM_NO_DEPRECATED)
+add_compile_options(-std=c++11)
if (CYGWIN)
- add_definitions(-U__STRICT_ANSI__)
+ add_compile_options(-U__STRICT_ANSI__)
endif()
########################################################################
@@ -189,14 +187,18 @@ include_directories(${CMAKE_INCLUDE_PATH})
macro(find_opt_library_and_header _header_var _header _lib_var _lib _have_var)
if (${_have_var})
+ message("-- Looking for ${_header} in ${_lib}")
find_path(${_header_var} ${_header})
if (NOT ${_header_var})
+ message("-- Looking for ${_header} in ${_lib} - not found")
set(${_have_var} 0)
else()
find_library(${_lib_var} ${_lib})
if (NOT ${_lib_var})
+ message("-- Looking for ${_header} in ${_lib} - not found")
set(${_have_var} 0)
else()
+ message("-- Looking for ${_header} in ${_lib} - found")
include_directories(SYSTEM "${${_header_var}}")
set(${_have_var} 1)
endif()
@@ -246,8 +248,13 @@ if (MPFR_PATH AND EXISTS "${MPFR_PATH}/mpfr.h")
endif()
-check_library_exists(edit readline "" HAVE_EDIT)
-find_opt_library_and_header(EDIT_PATH histedit.h EDIT_LIB edit HAVE_EDIT)
+check_library_exists(edit add_history "" HAVE_EDIT)
+find_opt_library_and_header(EDIT_PATH editline/readline.h EDIT_LIB edit HAVE_EDIT)
+if (NOT HAVE_EDIT)
+check_library_exists(readline add_history "" HAVE_READLINE)
+find_opt_library_and_header(READLINE_PATH readline/history.h READLINE_LIB readline HAVE_READLINE)
+endif (NOT HAVE_EDIT)
+
#find_package(Gettext) # Used for running tests
@@ -269,6 +276,9 @@ macro(add_ledger_library_dependencies _target)
if (HAVE_EDIT)
target_link_libraries(${_target} ${EDIT_LIB})
endif()
+ if (HAVE_READLINE)
+ target_link_libraries(${_target} ${READLINE_LIB})
+ endif()
if (HAVE_GETTEXT)
target_link_libraries(${_target} ${INTL_LIB})
endif()