mirror of
https://github.com/harfang3d/harfang3d.git
synced 2024-06-01 14:02:16 +00:00
- trying to fix Finduuid for macos
This commit is contained in:
parent
3c6c66df0c
commit
c5869ada63
|
@ -1,30 +1,56 @@
|
||||||
#[[
|
#.rst:
|
||||||
Try to find libuuid
|
# Finduuid
|
||||||
Provides the following target and variables:
|
# -----------
|
||||||
* uuid : library target
|
#
|
||||||
* UUID_FOUND : set if libuuid was found
|
# Find libuuid, DCE compatible Universally Unique Identifier library.
|
||||||
* UUID_INCLUDE_DIR : libuuid include diretory
|
#
|
||||||
* UUID_LIBRARY : libuuid library file
|
# Result Variables
|
||||||
#]]
|
# ^^^^^^^^^^^^^^^^
|
||||||
find_path(UUID_INCLUDE_DIR
|
#
|
||||||
NAMES uuid/uuid.h
|
# This module will set the following variables in your project:
|
||||||
HINTS ${UUID_ROOT_DIR}
|
#
|
||||||
)
|
# ``UUID_FOUND``
|
||||||
|
# True if libuuid has been found.
|
||||||
find_library(UUID_LIBRARY
|
# ``UUID_INCLUDE_DIRS``
|
||||||
NAMES uuid
|
# Where to find uuid/uuid.h.
|
||||||
HINTS ${UUID_ROOT_DIR}
|
# ``UUID_LIBRARIES``
|
||||||
)
|
# The libraries to link against to use libuuid.
|
||||||
|
#
|
||||||
|
# Obsolete variables
|
||||||
|
# ^^^^^^^^^^^^^^^^^^
|
||||||
|
#
|
||||||
|
# The following variables may also be set, for backwards compatibility:
|
||||||
|
#
|
||||||
|
# ``UUID_LIBRARY``
|
||||||
|
# where to find the libuuid library (same as UUID_LIBRARIES).
|
||||||
|
# ``UUID_INCLUDE_DIR``
|
||||||
|
# where to find the uuid/uuid.h header (same as UUID_INCLUDE_DIRS).
|
||||||
|
|
||||||
|
include(CheckCXXSymbolExists)
|
||||||
|
include(CheckLibraryExists)
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
find_package_handle_standard_args(uuid REQUIRED_VARS UUID_LIBRARY UUID_INCLUDE_DIR)
|
|
||||||
|
|
||||||
mark_as_advanced(UUID_FOUND UUID_LIBRARY UUID_INCLUDE_DIR)
|
if(NOT UUID_INCLUDE_DIR)
|
||||||
|
find_path(UUID_INCLUDE_DIR uuid/uuid.h)
|
||||||
if(UUID_FOUND AND NOT TARGET uuid)
|
|
||||||
add_library(uuid UNKNOWN IMPORTED)
|
|
||||||
set_target_properties(uuid PROPERTIES
|
|
||||||
IMPORTED_LOCATION "${UUID_LIBRARY}"
|
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${UUID_INCLUDE_DIR}"
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(EXISTS UUID_INCLUDE_DIR)
|
||||||
|
set(UUID_INCLUDE_DIRS ${UUID_INCLUDE_DIR})
|
||||||
|
set(CMAKE_REQUIRED_INCLUDES ${UUID_INCLUDE_DIRS})
|
||||||
|
check_cxx_symbol_exists("uuid_generate_random" "uuid/uuid.h" _uuid_header_only)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT _uuid_header_only AND NOT UUID_LIBRARY)
|
||||||
|
check_library_exists("uuid" "uuid_generate_random" "" _have_libuuid)
|
||||||
|
if(_have_libuuid)
|
||||||
|
set(UUID_LIBRARY "uuid")
|
||||||
|
set(UUID_LIBRARIES ${UUID_LIBRARY})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
unset(CMAKE_REQUIRED_INCLUDES)
|
||||||
|
unset(_uuid_header_only)
|
||||||
|
unset(_have_libuuid)
|
||||||
|
|
||||||
|
find_package_handle_standard_args(uuid DEFAULT_MSG UUID_INCLUDE_DIR)
|
||||||
|
mark_as_advanced(UUID_INCLUDE_DIR UUID_LIBRARY)
|
|
@ -167,7 +167,7 @@ if(NOT WIN32)
|
||||||
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
|
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
|
||||||
find_package(uuid REQUIRED)
|
find_package(uuid REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
target_link_libraries(foundation PUBLIC uuid)
|
target_link_libraries(foundation PUBLIC ${UUID_LIBRARIES})
|
||||||
else()
|
else()
|
||||||
target_link_libraries(foundation PUBLIC Iphlpapi)
|
target_link_libraries(foundation PUBLIC Iphlpapi)
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user