aboutsummaryrefslogtreecommitdiff
path: root/dep
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2021-10-01 18:54:52 +0200
committerShauren <shauren.trinity@gmail.com>2021-10-06 10:36:33 +0200
commite073e09b86d8be7c55a49aa030fa703104561668 (patch)
treedd77f9076a9c8a09a0e3a8b2b3e6f3ddf3b75229 /dep
parentc029f21f3429ab12678e1497614dc7a086fc1703 (diff)
Build: Modernize readline finding script
(cherry picked from commit 203f1197b4ccf7d49212549817dd3b7f21ae8259)
Diffstat (limited to 'dep')
-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()