summaryrefslogtreecommitdiffstats
path: root/src/lua/cmake/FindReadline.cmake
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 18:24:20 +0000
commit483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch)
treee5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/lua/cmake/FindReadline.cmake
parentInitial commit. (diff)
downloadceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.tar.xz
ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.zip
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/lua/cmake/FindReadline.cmake25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/lua/cmake/FindReadline.cmake b/src/lua/cmake/FindReadline.cmake
new file mode 100644
index 00000000..5401a9b4
--- /dev/null
+++ b/src/lua/cmake/FindReadline.cmake
@@ -0,0 +1,25 @@
+# - Try to find Readline
+# Once done this will define
+# READLINE_FOUND - System has readline
+# READLINE_INCLUDE_DIRS - The readline include directories
+# READLINE_LIBRARIES - The libraries needed to use readline
+# READLINE_DEFINITIONS - Compiler switches required for using readline
+
+find_package ( PkgConfig )
+pkg_check_modules ( PC_READLINE QUIET readline )
+set ( READLINE_DEFINITIONS ${PC_READLINE_CFLAGS_OTHER} )
+
+find_path ( READLINE_INCLUDE_DIR readline/readline.h
+ HINTS ${PC_READLINE_INCLUDEDIR} ${PC_READLINE_INCLUDE_DIRS}
+ PATH_SUFFIXES readline )
+
+find_library ( READLINE_LIBRARY NAMES readline
+ HINTS ${PC_READLINE_LIBDIR} ${PC_READLINE_LIBRARY_DIRS} )
+
+set ( READLINE_LIBRARIES ${READLINE_LIBRARY} )
+set ( READLINE_INCLUDE_DIRS ${READLINE_INCLUDE_DIR} )
+
+include ( FindPackageHandleStandardArgs )
+# handle the QUIETLY and REQUIRED arguments and set READLINE_FOUND to TRUE
+# if all listed variables are TRUE
+find_package_handle_standard_args ( readline DEFAULT_MSG READLINE_LIBRARY READLINE_INCLUDE_DIR )