aboutsummaryrefslogtreecommitdiff
path: root/dep/readline
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2021-10-01 18:54:52 +0200
committerShauren <shauren.trinity@gmail.com>2021-10-01 18:54:52 +0200
commit203f1197b4ccf7d49212549817dd3b7f21ae8259 (patch)
treeccc58293ec269a9eae8415f14649c722f49c5e0e /dep/readline
parent4e71c5b685da4162c8271baf820ba8312dd7c90c (diff)
Build: Modernize readline finding script
Diffstat (limited to 'dep/readline')
-rw-r--r--dep/readline/CMakeLists.txt31
1 files changed, 6 insertions, 25 deletions
diff --git a/dep/readline/CMakeLists.txt b/dep/readline/CMakeLists.txt
index 693274e129e..22196aae9ca 100644
--- a/dep/readline/CMakeLists.txt
+++ b/dep/readline/CMakeLists.txt
@@ -8,31 +8,12 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-if( UNIX )
- # find Readline (terminal input library) includes and library
- #
- # READLINE_INCLUDE_DIR - where the directory containing the READLINE headers can be found
- # READLINE_LIBRARY - full path to the READLINE library
- find_path(READLINE_INCLUDE_DIR readline/readline.h)
- find_library(READLINE_LIBRARY NAMES readline)
-
- message(STATUS "Found Readline library: ${READLINE_LIBRARY}")
- message(STATUS "Include dir is: ${READLINE_INCLUDE_DIR}")
-
- if (NOT READLINE_INCLUDE_DIR OR NOT READLINE_LIBRARY)
- message(FATAL_ERROR "** Readline library not found!\n** Your distro may provide a binary for Readline e.g. for ubuntu try apt-get install libreadline5-dev")
- endif ()
+add_library(readline INTERFACE)
- add_library(readline SHARED IMPORTED GLOBAL)
-
- set_target_properties(readline
- PROPERTIES
- IMPORTED_LOCATION
- "${READLINE_LIBRARY}"
- INTERFACE_INCLUDE_DIRECTORIES
- "${READLINE_INCLUDE_DIR}")
+if( UNIX )
+ find_package(Readline REQUIRED)
-else()
- # Provide a dummy target
- add_library(readline INTERFACE)
+ target_link_libraries(readline
+ INTERFACE
+ Readline::Readline)
endif()