diff options
Diffstat (limited to 'project/cmake/modules/FindUUID.cmake')
| -rw-r--r-- | project/cmake/modules/FindUUID.cmake | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/project/cmake/modules/FindUUID.cmake b/project/cmake/modules/FindUUID.cmake new file mode 100644 index 0000000..173fac2 --- /dev/null +++ b/project/cmake/modules/FindUUID.cmake | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindUUID | ||
| 3 | # -------- | ||
| 4 | # Finds the libuuid library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # UUID_FOUND - system has libuuid | ||
| 9 | # UUID_INCLUDE_DIRS - the libuuid include directory | ||
| 10 | # UUID_LIBRARIES - the libuuid libraries | ||
| 11 | # | ||
| 12 | # and the following imported targets:: | ||
| 13 | # | ||
| 14 | # UUID::UUID - The libuuid library | ||
| 15 | |||
| 16 | if(PKG_CONFIG_FOUND) | ||
| 17 | pkg_check_modules(PC_UUID uuid QUIET) | ||
| 18 | endif() | ||
| 19 | |||
| 20 | find_path(UUID_INCLUDE_DIR uuid/uuid.h | ||
| 21 | PATHS ${PC_UUID_INCLUDEDIR}) | ||
| 22 | find_library(UUID_LIBRARY uuid | ||
| 23 | PATHS ${PC_UUID_LIBRARY}) | ||
| 24 | set(UUID_VERSION ${PC_UUID_VERSION}) | ||
| 25 | |||
| 26 | include(FindPackageHandleStandardArgs) | ||
| 27 | find_package_handle_standard_args(UUID | ||
| 28 | REQUIRED_VARS UUID_LIBRARY UUID_INCLUDE_DIR | ||
| 29 | VERSION_VAR UUID_VERSION) | ||
| 30 | |||
| 31 | if(UUID_FOUND) | ||
| 32 | set(UUID_LIBRARIES ${UUID_LIBRARY}) | ||
| 33 | set(UUID_INCLUDE_DIRS ${UUID_INCLUDE_DIR}) | ||
| 34 | |||
| 35 | if(NOT TARGET UUID::UUID) | ||
| 36 | add_library(UUID::UUID UNKNOWN IMPORTED) | ||
| 37 | set_target_properties(UUID::UUID PROPERTIES | ||
| 38 | IMPORTED_LOCATION "${UUID_LIBRARY}" | ||
| 39 | INTERFACE_INCLUDE_DIRECTORIES "${UUID_INCLUDE_DIR}") | ||
| 40 | endif() | ||
| 41 | endif() | ||
| 42 | |||
| 43 | mark_as_advanced(UUID_INCLUDE_DIR UUID_LIBRARY) | ||
