summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexis Hildebrandt <afh@surryhill.net>2023-06-06 15:51:54 +0200
committerAlexis Hildebrandt <afh@surryhill.net>2023-06-07 09:09:42 +0200
commit1d422c32d6c3b137e8cb4a95b68fbd035107a7e5 (patch)
treed1707df8d962ab326503672bd9c75cf99d465904 /CMakeLists.txt
parent5e2afd286a332b93481750821be4785fbbd555a4 (diff)
downloadfork-ledger-1d422c32d6c3b137e8cb4a95b68fbd035107a7e5.tar.gz
fork-ledger-1d422c32d6c3b137e8cb4a95b68fbd035107a7e5.tar.bz2
fork-ledger-1d422c32d6c3b137e8cb4a95b68fbd035107a7e5.zip
Add build support readline
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt16
1 files changed, 14 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 712aa714..ced9172c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -189,14 +189,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 +250,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 +278,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()