|
1 | 1 |
|
2 | | -# Users can pass LIBUNWIND_ROOT, LIBUNWIND_INCLUDE_DIR, and LIBUNWIND_LIBRARY as CMake variables. |
3 | | -# If LIBUNWIND_ROOT is provided, the INCLUDE_DIR and LIBRARY variables may be omitted. |
| 2 | +# Users can pass libunwind_ROOT, libunwind_INCLUDE_DIR, and libunwind_LIBRARY as CMake variables. |
| 3 | +# If libunwind_ROOT is provided, the INCLUDE_DIR and LIBRARY variables may be omitted. |
4 | 4 | # |
5 | | -# LIBUNWIND_FOUND, LIBUNWIND_INCLUDE_DIRS, and LIBUNWIND_LIBRARIES are outputs |
| 5 | +# libunwind_FOUND, libunwind_INCLUDE_DIRS, and libunwind_LIBRARIES are outputs |
6 | 6 |
|
7 | | -if(LIBUNWIND_ROOT) |
8 | | - set(LIBUNWIND_INCLUDE_DIR ${LIBUNWIND_INCLUDE_DIR};${LIBUNWIND_ROOT}/include) |
9 | | - set(LIBUNWIND_LIBRARY ${LIBUNWIND_LIBRARY};${LIBUNWIND_ROOT}/lib64;${LIBUNWIND_ROOT}/lib) |
| 7 | +if(libunwind_ROOT) |
| 8 | + set(libunwind_INCLUDE_DIR ${libunwind_INCLUDE_DIR};${libunwind_ROOT}/include) |
| 9 | + set(libunwind_LIBRARY ${libunwind_LIBRARY};${libunwind_ROOT}/lib64;${libunwind_ROOT}/lib) |
10 | 10 | endif() |
11 | 11 |
|
12 | 12 | # First, check only in the hinted paths |
13 | | -find_path(LIBUNWIND_INCLUDE_DIRS NAMES libunwind.h |
| 13 | +find_path(libunwind_INCLUDE_DIRS NAMES libunwind.h |
14 | 14 | DOC "The libunwind include directory" |
15 | | - HINTS ${LIBUNWIND_INCLUDE_DIR} |
| 15 | + HINTS ${libunwind_INCLUDE_DIR} |
16 | 16 | NO_DEFAULT_PATH |
17 | 17 | ) |
18 | | -find_library(LIBUNWIND_LIBRARIES NAMES unwind |
| 18 | +find_library(libunwind_LIBRARIES NAMES unwind |
19 | 19 | DOC "The libunwind library" |
20 | | - HINTS ${LIBUNWIND_LIBRARY} |
| 20 | + HINTS ${libunwind_LIBRARY} |
21 | 21 | NO_DEFAULT_PATH |
22 | 22 | ) |
23 | 23 |
|
24 | 24 | # If that fails, check in CMake's default paths |
25 | | -find_path(LIBUNWIND_INCLUDE_DIRS NAMES libunwind.h |
| 25 | +find_path(libunwind_INCLUDE_DIRS NAMES libunwind.h |
26 | 26 | DOC "The libunwind include directory" |
27 | 27 | ) |
28 | | -find_library(LIBUNWIND_LIBRARIES NAMES unwind |
| 28 | +find_library(libunwind_LIBRARIES NAMES unwind |
29 | 29 | DOC "The libunwind library" |
30 | 30 | ) |
31 | 31 |
|
32 | 32 | include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) |
33 | | -FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBUNWIND |
34 | | - REQUIRED_VARS LIBUNWIND_LIBRARIES LIBUNWIND_INCLUDE_DIRS) |
| 33 | +FIND_PACKAGE_HANDLE_STANDARD_ARGS(libunwind |
| 34 | + REQUIRED_VARS libunwind_LIBRARIES libunwind_INCLUDE_DIRS) |
35 | 35 |
|
36 | | -if(LIBUNWIND_FOUND) |
| 36 | +if(libunwind_FOUND) |
37 | 37 | if(NOT TARGET libunwind) |
38 | 38 | add_library(libunwind UNKNOWN IMPORTED) |
39 | | - set_target_properties(libunwind PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LIBUNWIND_INCLUDE_DIRS}") |
40 | | - set_property(TARGET libunwind APPEND PROPERTY IMPORTED_LOCATION "${LIBUNWIND_LIBRARY}") |
| 39 | + set_target_properties(libunwind PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${libunwind_INCLUDE_DIRS}") |
| 40 | + set_property(TARGET libunwind APPEND PROPERTY IMPORTED_LOCATION "${libunwind_LIBRARY}") |
41 | 41 | endif() |
42 | 42 | endif() |
0 commit comments