diff options
Diffstat (limited to 'cmake/modules')
-rw-r--r-- | cmake/modules/FindReadline.cmake | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/cmake/modules/FindReadline.cmake b/cmake/modules/FindReadline.cmake deleted file mode 100644 index 5e110da..0000000 --- a/cmake/modules/FindReadline.cmake +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
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 | set(Readline_VERSION Readline_VERSION-NOTFOUND) | ||
35 | if (Readline_INCLUDE_DIR) | ||
36 | if(EXISTS "${Readline_INCLUDE_DIR}/readline/readline.h") | ||
37 | file(STRINGS "${Readline_INCLUDE_DIR}/readline/readline.h" _Readline_HEADER_CONTENTS REGEX "#define RL_VERSION_[A-Z]+") | ||
38 | string(REGEX REPLACE ".*#define RL_VERSION_MAJOR[ \t]+([0-9]+).*" "\\1" Readline_VERSION_MAJOR "${_Readline_HEADER_CONTENTS}") | ||
39 | string(REGEX REPLACE ".*#define RL_VERSION_MINOR[ \t]+([0-9]+).*" "\\1" Readline_VERSION_MINOR "${_Readline_HEADER_CONTENTS}") | ||
40 | set(Readline_VERSION ${Readline_VERSION_MAJOR}.${Readline_VERSION_MINOR}) | ||
41 | unset(_Readline_HEADER_CONTENTS) | ||
42 | endif() | ||
43 | endif() | ||
44 | |||
45 | find_package_handle_standard_args(Readline FOUND_VAR Readline_FOUND | ||
46 | REQUIRED_VARS Readline_LIBRARY Readline_INCLUDE_DIR Readline_ROOT_DIR | ||
47 | VERSION_VAR Readline_VERSION) | ||