diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-12-26 19:19:11 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-12-26 19:19:11 +0100 |
commit | 8ef8b8dee60aa0a81fbb2cbba30c00d3b15bb771 (patch) | |
tree | 06be3618505d45e6e2886fb614c96689a5555364 /cmake/modules/FindReadline.cmake | |
parent | fc7052f0970465d41dfd67c7e5db080498fd060f (diff) | |
parent | 67a19008d078a067ceb3424c00553c33b918970e (diff) | |
download | sink-8ef8b8dee60aa0a81fbb2cbba30c00d3b15bb771.tar.gz sink-8ef8b8dee60aa0a81fbb2cbba30c00d3b15bb771.zip |
Merge branch 'feature/new_cli' into develop
Diffstat (limited to 'cmake/modules/FindReadline.cmake')
-rw-r--r-- | cmake/modules/FindReadline.cmake | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/cmake/modules/FindReadline.cmake b/cmake/modules/FindReadline.cmake new file mode 100644 index 0000000..883ad3f --- /dev/null +++ b/cmake/modules/FindReadline.cmake | |||
@@ -0,0 +1,47 @@ | |||
1 | # - Try to find readline include dirs and libraries | ||
2 | # | ||
3 | # Usage of this module as follows: | ||
4 | # | ||
5 | # find_package(Readline) | ||
6 | # | ||
7 | # Variables used by this module, they can change the default behaviour and need | ||
8 | # to be set before calling find_package: | ||
9 | # | ||
10 | # Readline_ROOT_DIR Set this variable to the root installation of | ||
11 | # readline if the module has problems finding the | ||
12 | # proper installation path. | ||
13 | # | ||
14 | # Variables defined by this module: | ||
15 | # | ||
16 | # READLINE_FOUND System has readline, include and lib dirs found | ||
17 | # Readline_INCLUDE_DIR The readline include directories. | ||
18 | # Readline_LIBRARY The readline library. | ||
19 | |||
20 | find_path(Readline_ROOT_DIR | ||
21 | NAMES include/readline/readline.h | ||
22 | ) | ||
23 | |||
24 | find_path(Readline_INCLUDE_DIR | ||
25 | NAMES readline/readline.h | ||
26 | HINTS ${Readline_ROOT_DIR}/include | ||
27 | ) | ||
28 | |||
29 | find_library(Readline_LIBRARY | ||
30 | NAMES readline | ||
31 | HINTS ${Readline_ROOT_DIR}/lib | ||
32 | ) | ||
33 | |||
34 | if(Readline_INCLUDE_DIR AND Readline_LIBRARY AND Ncurses_LIBRARY) | ||
35 | set(READLINE_FOUND TRUE) | ||
36 | else(Readline_INCLUDE_DIR AND Readline_LIBRARY AND Ncurses_LIBRARY) | ||
37 | FIND_LIBRARY(Readline_LIBRARY NAMES readline) | ||
38 | include(FindPackageHandleStandardArgs) | ||
39 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(Readline DEFAULT_MSG Readline_INCLUDE_DIR Readline_LIBRARY ) | ||
40 | MARK_AS_ADVANCED(Readline_INCLUDE_DIR Readline_LIBRARY) | ||
41 | endif(Readline_INCLUDE_DIR AND Readline_LIBRARY AND Ncurses_LIBRARY) | ||
42 | |||
43 | mark_as_advanced( | ||
44 | Readline_ROOT_DIR | ||
45 | Readline_INCLUDE_DIR | ||
46 | Readline_LIBRARY | ||
47 | ) | ||