forked from IoLanguage/io
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pull in FindUUID.cmake from FreeRDP, to avoid detecting uuid.h under …
…/System/…/Kernel.framework on macOS This fixes a build problem due to apparent bad `sys/ucontext.h` headers in Kernel.framework.
- Loading branch information
Showing
1 changed file
with
114 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,119 @@ | ||
# Base Io build system | ||
# Written by Jeremy Tregunna <jeremy.tregunna@me.com> | ||
# - Try to find UUID | ||
# Once done this will define | ||
# | ||
# Find libuuid | ||
# UUID_FOUND - system has UUID | ||
# UUID_INCLUDE_DIRS - the UUID include directory | ||
# UUID_LIBRARIES - Link these to use UUID | ||
# UUID_DEFINITIONS - Compiler switches required for using UUID | ||
# | ||
# Copyright (c) 2006 Andreas Schneider <mail@cynapses.org> | ||
# | ||
# Redistribution and use is allowed according to the terms of the New | ||
# BSD license. | ||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. | ||
# | ||
|
||
|
||
if (UUID_LIBRARIES AND UUID_INCLUDE_DIRS) | ||
# in cache already | ||
set(UUID_FOUND TRUE) | ||
else (UUID_LIBRARIES AND UUID_INCLUDE_DIRS) | ||
find_path(UUID_INCLUDE_DIR | ||
NAMES | ||
uuid.h | ||
PATH_SUFFIXES | ||
uuid | ||
HINTS | ||
${UUID_DIR}/include | ||
$ENV{UUID_DIR}/include | ||
$ENV{UUID_DIR} | ||
${DELTA3D_EXT_DIR}/inc | ||
$ENV{DELTA_ROOT}/ext/inc | ||
$ENV{DELTA_ROOT} | ||
PATHS | ||
~/Library/Frameworks | ||
/Library/Frameworks | ||
/usr/local/include | ||
/usr/include | ||
/usr/include/gdal | ||
/sw/include # Fink | ||
/opt/local/include # DarwinPorts | ||
/opt/csw/include # Blastwave | ||
/opt/include | ||
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include | ||
/usr/freeware/include | ||
) | ||
|
||
find_library(UUID_LIBRARY | ||
NAMES | ||
uuid ossp-uuid | ||
HINTS | ||
${UUID_DIR}/lib | ||
$ENV{UUID_DIR}/lib | ||
$ENV{UUID_DIR} | ||
${DELTA3D_EXT_DIR}/lib | ||
$ENV{DELTA_ROOT}/ext/lib | ||
$ENV{DELTA_ROOT} | ||
$ENV{OSG_ROOT}/lib | ||
PATHS | ||
~/Library/Frameworks | ||
/Library/Frameworks | ||
/usr/local/lib | ||
/usr/lib | ||
/sw/lib | ||
/opt/local/lib | ||
/opt/csw/lib | ||
/opt/lib | ||
/usr/freeware/lib64 | ||
) | ||
|
||
find_library(UUID_LIBRARY_DEBUG | ||
NAMES | ||
uuidd | ||
HINTS | ||
${UUID_DIR}/lib | ||
$ENV{UUID_DIR}/lib | ||
$ENV{UUID_DIR} | ||
${DELTA3D_EXT_DIR}/lib | ||
$ENV{DELTA_ROOT}/ext/lib | ||
$ENV{DELTA_ROOT} | ||
$ENV{OSG_ROOT}/lib | ||
PATHS | ||
~/Library/Frameworks | ||
/Library/Frameworks | ||
/usr/local/lib | ||
/usr/lib | ||
/sw/lib | ||
/opt/local/lib | ||
/opt/csw/lib | ||
/opt/lib | ||
/usr/freeware/lib64 | ||
) | ||
|
||
if (NOT UUID_LIBRARY AND BSD) | ||
set(UUID_LIBRARY "") | ||
endif(NOT UUID_LIBRARY AND BSD) | ||
|
||
set(UUID_INCLUDE_DIRS ${UUID_INCLUDE_DIR}) | ||
set(UUID_LIBRARIES ${UUID_LIBRARY}) | ||
|
||
FIND_PATH(UUID_INCLUDE_DIR uuid/uuid.h) | ||
FIND_LIBRARY(UUID_LIBRARY NAMES uuid PATH) | ||
if (UUID_INCLUDE_DIRS) | ||
if (BSD OR UUID_LIBRARIES) | ||
set(UUID_FOUND TRUE) | ||
endif (BSD OR UUID_LIBRARIES) | ||
endif (UUID_INCLUDE_DIRS) | ||
|
||
IF(NOT UUID_LIBRARY) | ||
SET(UUID_LIBRARY "") | ||
ENDIF(NOT UUID_LIBRARY) | ||
if (UUID_FOUND) | ||
if (NOT UUID_FIND_QUIETLY) | ||
message(STATUS "Found UUID: ${UUID_LIBRARIES}") | ||
endif (NOT UUID_FIND_QUIETLY) | ||
else (UUID_FOUND) | ||
if (UUID_FIND_REQUIRED) | ||
message(FATAL_ERROR "Could not find UUID") | ||
endif (UUID_FIND_REQUIRED) | ||
endif (UUID_FOUND) | ||
|
||
IF(UUID_INCLUDE_DIR) | ||
SET(UUID_FOUND TRUE) | ||
ENDIF(UUID_INCLUDE_DIR) | ||
# show the UUID_INCLUDE_DIRS and UUID_LIBRARIES variables only in the advanced view | ||
mark_as_advanced(UUID_INCLUDE_DIRS UUID_LIBRARIES) | ||
|
||
IF(NOT UUID_FOUND) | ||
IF(UUID_FIND_REQUIRED) | ||
MESSAGE(FATAL_ERROR "Could not find UUID") | ||
ENDIF(UUID_FIND_REQUIRED) | ||
ENDIF(NOT UUID_FOUND) | ||
endif (UUID_LIBRARIES AND UUID_INCLUDE_DIRS) |