Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 34 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,40 @@ if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
set(default_build_type Debug)
endif()

# find_package() will load CMAKE_MODULE_PATH/FindReadline.cmake if
# it can't find Readline. FindReadline.cmake will be looked for
# in CMAKE_MODULE_PATH. FindReadline.cmake is sensitive to
# CMAKE_PREFIX_PATH setting.
set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

if (GNUREADLINE)
find_package(PkgConfig)
find_package(Readline QUIET)
endif()

if(READLINE_FOUND)
message(STATUS "Found Readline via find_package()")
include_directories(${READLINE_INCLUDE_DIRS})
# link_directories(${READLINE_LIBRARY_DIRS})
link_libraries(${READLINE_LIBRARIES})
else()
if (GNUREADLINE)
message(WARNING "EEEeeeeks! GNU Readline package could not by found. Setting GNUREADLINE=OFF")
endif()
set(GNUREADLINE OFF)
endif()

# if (GNUREADLINE)
# message("parafeed: Using GNU readline library")
# pkg_search_module(readline REQUIRED IMPORTED_TARGET readline)
# # get_target_property(_readline_interface_include_dirs
# # PkgConfig::readline INTERFACE_INCLUDE_DIRECTORIES)
# add_library(readline SHARED IMPORTED)
# #set_target_properties(readline PROPERTIES IMPORTED_LOCATION /usr/lib/x86_64-linux-gnu/libreadline.so)
# set_target_properties(readline PROPERTIES INTERFACE_INCLUDE_DIRECTORIES /usr/include)
# endif()

# Set the default for using the GNU readline and histroy package

if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS
Expand Down Expand Up @@ -73,15 +107,6 @@ else()
message("Building with the complier default ABI setting")
endif()

if (GNUREADLINE)
message("parafeed: Using GNU readline library")
pkg_search_module(readline REQUIRED IMPORTED_TARGET readline)
# get_target_property(_readline_interface_include_dirs
# PkgConfig::readline INTERFACE_INCLUDE_DIRECTORIES)
add_library(readline SHARED IMPORTED)
#set_target_properties(readline PROPERTIES IMPORTED_LOCATION /usr/lib/x86_64-linux-gnu/libreadline.so)
set_target_properties(readline PROPERTIES INTERFACE_INCLUDE_DIRECTORIES /usr/include)
endif()

# work around a problem in which the readline.pc file declares
# "Requires.private: termcap", which prevents setting the
Expand Down
Loading