|
8 | 8 | #
|
9 | 9 | # ::
|
10 | 10 | #
|
11 |
| -# libedit_FOUND - true if libedit was found |
12 |
| -# libedit_INCLUDE_DIRS - include search path |
13 |
| -# libedit_LIBRARIES - libraries to link |
14 |
| -# libedit_VERSION - version number |
| 11 | +# LibEdit_FOUND - true if libedit was found |
| 12 | +# LibEdit_INCLUDE_DIRS - include search path |
| 13 | +# LibEdit_LIBRARIES - libraries to link |
| 14 | +# LibEdit_VERSION_STRING - version number |
15 | 15 |
|
16 |
| -if(libedit_INCLUDE_DIRS AND libedit_LIBRARIES) |
17 |
| - set(libedit_FOUND TRUE) |
| 16 | +if(LibEdit_INCLUDE_DIRS AND LibEdit_LIBRARIES) |
| 17 | + set(LibEdit_FOUND TRUE) |
18 | 18 | else()
|
19 | 19 | find_package(PkgConfig QUIET)
|
20 | 20 | pkg_check_modules(PC_LIBEDIT QUIET libedit)
|
21 | 21 |
|
22 |
| - find_path(libedit_INCLUDE_DIRS |
| 22 | + find_path(LibEdit_INCLUDE_DIRS |
23 | 23 | NAMES
|
24 | 24 | histedit.h
|
25 | 25 | HINTS
|
26 | 26 | ${PC_LIBEDIT_INCLUDEDIR}
|
27 | 27 | ${PC_LIBEDIT_INCLUDE_DIRS}
|
28 | 28 | ${CMAKE_INSTALL_FULL_INCLUDEDIR})
|
29 |
| - find_library(libedit_LIBRARIES |
| 29 | + find_library(LibEdit_LIBRARIES |
30 | 30 | NAMES
|
31 | 31 | edit libedit
|
32 | 32 | HINTS
|
33 | 33 | ${PC_LIBEDIT_LIBDIR}
|
34 | 34 | ${PC_LIBEDIT_LIBRARY_DIRS}
|
35 | 35 | ${CMAKE_INSTALL_FULL_LIBDIR})
|
36 | 36 |
|
37 |
| - if(libedit_INCLUDE_DIRS AND EXISTS "${libedit_INCLUDE_DIRS}/histedit.h") |
38 |
| - file(STRINGS "${libedit_INCLUDE_DIRS}/histedit.h" |
| 37 | + if(LibEdit_INCLUDE_DIRS AND EXISTS "${LibEdit_INCLUDE_DIRS}/histedit.h") |
| 38 | + file(STRINGS "${LibEdit_INCLUDE_DIRS}/histedit.h" |
39 | 39 | libedit_major_version_str
|
40 | 40 | REGEX "^#define[ \t]+LIBEDIT_MAJOR[ \t]+[0-9]+")
|
41 | 41 | string(REGEX REPLACE "^#define[ \t]+LIBEDIT_MAJOR[ \t]+([0-9]+)" "\\1"
|
42 | 42 | LIBEDIT_MAJOR_VERSION "${libedit_major_version_str}")
|
43 | 43 |
|
44 |
| - file(STRINGS "${libedit_INCLUDE_DIRS}/histedit.h" |
| 44 | + file(STRINGS "${LibEdit_INCLUDE_DIRS}/histedit.h" |
45 | 45 | libedit_minor_version_str
|
46 | 46 | REGEX "^#define[ \t]+LIBEDIT_MINOR[ \t]+[0-9]+")
|
47 | 47 | string(REGEX REPLACE "^#define[ \t]+LIBEDIT_MINOR[ \t]+([0-9]+)" "\\1"
|
48 | 48 | LIBEDIT_MINOR_VERSION "${libedit_minor_version_str}")
|
49 | 49 |
|
50 |
| - set(libedit_VERSION_STRING "${libedit_major_version}.${libedit_minor_version}") |
| 50 | + set(LibEdit_VERSION_STRING "${libedit_major_version}.${libedit_minor_version}") |
51 | 51 | endif()
|
52 | 52 |
|
53 | 53 | include(FindPackageHandleStandardArgs)
|
54 |
| - find_package_handle_standard_args(libedit |
| 54 | + find_package_handle_standard_args(LibEdit |
| 55 | + FOUND_VAR |
| 56 | + LibEdit_FOUND |
55 | 57 | REQUIRED_VARS
|
56 |
| - libedit_INCLUDE_DIRS |
57 |
| - libedit_LIBRARIES |
| 58 | + LibEdit_INCLUDE_DIRS |
| 59 | + LibEdit_LIBRARIES |
58 | 60 | VERSION_VAR
|
59 |
| - libedit_VERSION_STRING) |
60 |
| - mark_as_advanced(libedit_INCLUDE_DIRS libedit_LIBRARIES) |
| 61 | + LibEdit_VERSION_STRING) |
| 62 | + mark_as_advanced(LibEdit_INCLUDE_DIRS LibEdit_LIBRARIES) |
61 | 63 | endif()
|
| 64 | + |
0 commit comments