Skip to content

Commit

Permalink
[CMake] Update Findlibuuid.cmake to provide imported target for uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
amadio committed Mar 20, 2023
1 parent 96bdb1d commit 5af095f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cmake/Findlibuuid.cmake
Expand Up @@ -4,6 +4,14 @@
#
# Find libuuid, DCE compatible Universally Unique Identifier library.
#
# Imported Targets
# ^^^^^^^^^^^^^^^^
#
# This module defines :prop_tgt:`IMPORTED` target:
#
# ``uuid::uuid``
# The libuuid library, if found.
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
Expand Down Expand Up @@ -52,5 +60,11 @@ unset(CMAKE_REQUIRED_INCLUDES)
unset(_uuid_header_only)
unset(_have_libuuid)

if(NOT TARGET uuid::uuid)
add_library(uuid::uuid INTERFACE IMPORTED)
set_property(TARGET uuid::uuid PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${UUID_INCLUDE_DIRS}")
set_property(TARGET uuid::uuid PROPERTY INTERFACE_LINK_LIBRARIES "${UUID_LIBRARIES}")
endif()

find_package_handle_standard_args(libuuid DEFAULT_MSG UUID_INCLUDE_DIR)
mark_as_advanced(UUID_INCLUDE_DIR UUID_LIBRARY)

0 comments on commit 5af095f

Please sign in to comment.