diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
commit | c04dcc2e7d834218ef2d4194331e383402495ae1 (patch) | |
tree | 7333e38d10d75386e60f336b80c2443c1166031d /cmake/modules/FindUUID.cmake | |
parent | Initial commit. (diff) | |
download | kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.tar.xz kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.zip |
Adding upstream version 2:20.4+dfsg.upstream/2%20.4+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmake/modules/FindUUID.cmake')
-rw-r--r-- | cmake/modules/FindUUID.cmake | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/cmake/modules/FindUUID.cmake b/cmake/modules/FindUUID.cmake new file mode 100644 index 0000000..0c2ff5a --- /dev/null +++ b/cmake/modules/FindUUID.cmake @@ -0,0 +1,43 @@ +#.rst: +# FindUUID +# -------- +# Finds the libuuid library +# +# This will define the following variables:: +# +# UUID_FOUND - system has libuuid +# UUID_INCLUDE_DIRS - the libuuid include directory +# UUID_LIBRARIES - the libuuid libraries +# +# and the following imported targets:: +# +# UUID::UUID - The libuuid library + +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_UUID uuid QUIET) +endif() + +find_path(UUID_INCLUDE_DIR uuid/uuid.h + PATHS ${PC_UUID_INCLUDEDIR}) +find_library(UUID_LIBRARY uuid + PATHS ${PC_UUID_LIBRARY}) +set(UUID_VERSION ${PC_UUID_VERSION}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(UUID + REQUIRED_VARS UUID_LIBRARY UUID_INCLUDE_DIR + VERSION_VAR UUID_VERSION) + +if(UUID_FOUND) + set(UUID_LIBRARIES ${UUID_LIBRARY}) + set(UUID_INCLUDE_DIRS ${UUID_INCLUDE_DIR}) + + if(NOT TARGET UUID::UUID) + add_library(UUID::UUID UNKNOWN IMPORTED) + set_target_properties(UUID::UUID PROPERTIES + IMPORTED_LOCATION "${UUID_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${UUID_INCLUDE_DIR}") + endif() +endif() + +mark_as_advanced(UUID_INCLUDE_DIR UUID_LIBRARY) |