Keep readline optional

This commit is contained in:
Jethro Grassie 2018-01-11 00:50:41 -05:00
parent 35d5aa36c9
commit be1826c0fb
No known key found for this signature in database
GPG Key ID: DE8ED755616565BB
5 changed files with 14 additions and 6 deletions

View File

@ -15,8 +15,11 @@
# #
# READLINE_FOUND System has readline, include and lib dirs found # READLINE_FOUND System has readline, include and lib dirs found
# GNU_READLINE_FOUND Version of readline found is GNU readline, not libedit! # 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_INCLUDE_DIR The readline include directories.
# Readline_LIBRARY The readline library. # 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 find_path(Readline_ROOT_DIR
NAMES include/readline/readline.h 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) check_function_exists(rl_filename_completion_function HAVE_COMPLETION_FUNCTION)
if(NOT HAVE_COMPLETION_FUNCTION) if(NOT HAVE_COMPLETION_FUNCTION)
unset(READLINE_FOUND)
set(CMAKE_REQUIRED_LIBRARIES ${Readline_LIBRARY} ${Termcap_LIBRARY}) set(CMAKE_REQUIRED_LIBRARIES ${Readline_LIBRARY} ${Termcap_LIBRARY})
check_function_exists(rl_copy_text HAVE_COPY_TEXT_TC) check_function_exists(rl_copy_text HAVE_COPY_TEXT_TC)
check_function_exists(rl_filename_completion_function HAVE_COMPLETION_FUNCTION_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(HAVE_COMPLETION_FUNCTION)
endif(NOT HAVE_COMPLETION_FUNCTION) endif(NOT HAVE_COMPLETION_FUNCTION)
set(LIBEDIT_LIBRARY "")
set(GNU_READLINE_LIBRARY "")
if(HAVE_COMPLETION_FUNCTION AND HAVE_COPY_TEXT) if(HAVE_COMPLETION_FUNCTION AND HAVE_COPY_TEXT)
set(GNU_READLINE_FOUND TRUE) 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) endif(HAVE_COMPLETION_FUNCTION AND HAVE_COPY_TEXT)

View File

@ -64,5 +64,5 @@ if (USE_READLINE AND GNU_READLINE_FOUND)
PUBLIC PUBLIC
easylogging easylogging
PRIVATE PRIVATE
${Readline_LIBRARY}) ${GNU_READLINE_LIBRARY})
endif() endif()

View File

@ -102,7 +102,7 @@ target_link_libraries(daemon
${Boost_SYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
${ZMQ_LIB} ${ZMQ_LIB}
${Readline_LIBRARY} ${GNU_READLINE_LIBRARY}
${EXTRA_LIBRARIES}) ${EXTRA_LIBRARIES})
set_property(TARGET daemon set_property(TARGET daemon
PROPERTY PROPERTY

View File

@ -43,8 +43,8 @@ target_link_libraries(gen_multisig
${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_FILESYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY} ${Boost_THREAD_LIBRARY}
${Readline_LIBRARY}
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
${GNU_READLINE_LIBRARY}
${EXTRA_LIBRARIES}) ${EXTRA_LIBRARIES})
add_dependencies(gen_multisig add_dependencies(gen_multisig
version) version)

View File

@ -55,8 +55,8 @@ target_link_libraries(simplewallet
${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_FILESYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY} ${Boost_THREAD_LIBRARY}
${Readline_LIBRARY}
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
${GNU_READLINE_LIBRARY}
${EXTRA_LIBRARIES}) ${EXTRA_LIBRARIES})
set_property(TARGET simplewallet set_property(TARGET simplewallet
PROPERTY PROPERTY