aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--cmake/FindReadline.cmake12
-rw-r--r--contrib/epee/src/CMakeLists.txt2
-rw-r--r--src/daemon/CMakeLists.txt2
-rw-r--r--src/gen_multisig/CMakeLists.txt2
-rw-r--r--src/simplewallet/CMakeLists.txt2
5 files changed, 14 insertions, 6 deletions
diff --git a/cmake/FindReadline.cmake b/cmake/FindReadline.cmake
index 7a11a270a..87f8ccace 100644
--- a/cmake/FindReadline.cmake
+++ b/cmake/FindReadline.cmake
@@ -15,8 +15,11 @@
#
# READLINE_FOUND System has readline, include and lib dirs found
# GNU_READLINE_FOUND Version of readline found is GNU readline, not libedit!
+# LIBEDIT_FOUND Version of readline found is libedit, not GNU readline!
# Readline_INCLUDE_DIR The readline include directories.
# Readline_LIBRARY The readline library.
+# GNU_READLINE_LIBRARY The GNU readline library or empty string.
+# LIBEDIT_LIBRARY The libedit library or empty string.
find_path(Readline_ROOT_DIR
NAMES include/readline/readline.h
@@ -63,7 +66,6 @@ check_function_exists(rl_copy_text HAVE_COPY_TEXT)
check_function_exists(rl_filename_completion_function HAVE_COMPLETION_FUNCTION)
if(NOT HAVE_COMPLETION_FUNCTION)
- unset(READLINE_FOUND)
set(CMAKE_REQUIRED_LIBRARIES ${Readline_LIBRARY} ${Termcap_LIBRARY})
check_function_exists(rl_copy_text HAVE_COPY_TEXT_TC)
check_function_exists(rl_filename_completion_function HAVE_COMPLETION_FUNCTION_TC)
@@ -74,8 +76,14 @@ if(NOT HAVE_COMPLETION_FUNCTION)
endif(HAVE_COMPLETION_FUNCTION)
endif(NOT HAVE_COMPLETION_FUNCTION)
+set(LIBEDIT_LIBRARY "")
+set(GNU_READLINE_LIBRARY "")
+
if(HAVE_COMPLETION_FUNCTION AND HAVE_COPY_TEXT)
set(GNU_READLINE_FOUND TRUE)
- set(READLINE_FOUND TRUE)
+ set(GNU_READLINE_LIBRARY ${Readline_LIBRARY})
+elseif(READLINE_FOUND AND NOT HAVE_COPY_TEXT)
+ set(LIBEDIT_FOUND TRUE)
+ set(LIBEDIT_LIBRARY ${Readline_LIBRARY})
endif(HAVE_COMPLETION_FUNCTION AND HAVE_COPY_TEXT)
diff --git a/contrib/epee/src/CMakeLists.txt b/contrib/epee/src/CMakeLists.txt
index 9d104ceeb..538c7ce91 100644
--- a/contrib/epee/src/CMakeLists.txt
+++ b/contrib/epee/src/CMakeLists.txt
@@ -64,5 +64,5 @@ if (USE_READLINE AND GNU_READLINE_FOUND)
PUBLIC
easylogging
PRIVATE
- ${Readline_LIBRARY})
+ ${GNU_READLINE_LIBRARY})
endif()
diff --git a/src/daemon/CMakeLists.txt b/src/daemon/CMakeLists.txt
index 49d3bc836..237105d06 100644
--- a/src/daemon/CMakeLists.txt
+++ b/src/daemon/CMakeLists.txt
@@ -102,7 +102,7 @@ target_link_libraries(daemon
${Boost_SYSTEM_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
${ZMQ_LIB}
- ${Readline_LIBRARY}
+ ${GNU_READLINE_LIBRARY}
${EXTRA_LIBRARIES})
set_property(TARGET daemon
PROPERTY
diff --git a/src/gen_multisig/CMakeLists.txt b/src/gen_multisig/CMakeLists.txt
index ff3c46862..8c534d213 100644
--- a/src/gen_multisig/CMakeLists.txt
+++ b/src/gen_multisig/CMakeLists.txt
@@ -43,8 +43,8 @@ target_link_libraries(gen_multisig
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY}
- ${Readline_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
+ ${GNU_READLINE_LIBRARY}
${EXTRA_LIBRARIES})
add_dependencies(gen_multisig
version)
diff --git a/src/simplewallet/CMakeLists.txt b/src/simplewallet/CMakeLists.txt
index beaacf0e9..f190ada8d 100644
--- a/src/simplewallet/CMakeLists.txt
+++ b/src/simplewallet/CMakeLists.txt
@@ -55,8 +55,8 @@ target_link_libraries(simplewallet
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY}
- ${Readline_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
+ ${GNU_READLINE_LIBRARY}
${EXTRA_LIBRARIES})
set_property(TARGET simplewallet
PROPERTY