forked from Slicer/Slicer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSlicerInitializeOSXVariables.cmake
57 lines (50 loc) · 1.94 KB
/
SlicerInitializeOSXVariables.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
################################################################################
#
# Program: 3D Slicer
#
# Copyright (c) Kitware Inc.
#
# See COPYRIGHT.txt
# or http://www.slicer.org/copyright/copyright.txt for details.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This file was originally developed by Jean-Christophe Fillion-Robin, Kitware Inc.
# and was partially funded by NIH grant 3P41RR013218-12S1
#
################################################################################
#
# SlicerInitializeOSXVariables
#
#
# Adapted from Paraview/Superbuild/CMakeLists.txt
#
# Note: Change architecture *before* any enable_language() or project()
# calls so that it's set properly to detect 64-bit-ness, and
# deployment target for the standard c++ library.
#
if(APPLE)
# Disable universal binaries
if(NOT "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
list(LENGTH CMAKE_OSX_ARCHITECTURES arch_count)
if(arch_count GREATER 1)
message(FATAL_ERROR "error: Only one value (i386 or x86_64) should be associated with CMAKE_OSX_ARCHITECTURES.")
endif()
endif()
set(required_deployment_target "13.0")
if("x${CMAKE_OSX_DEPLOYMENT_TARGET}x" STREQUAL "xx")
set(CMAKE_OSX_DEPLOYMENT_TARGET ${required_deployment_target})
endif()
if(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS ${required_deployment_target})
message(FATAL_ERROR "CMAKE_OSX_DEPLOYMENT_TARGET ${CMAKE_OSX_DEPLOYMENT_TARGET} must be ${required_deployment_target} or greater.")
endif()
if(NOT "${CMAKE_OSX_SYSROOT}" STREQUAL "")
if(NOT EXISTS "${CMAKE_OSX_SYSROOT}")
message(FATAL_ERROR "error: CMAKE_OSX_SYSROOT='${CMAKE_OSX_SYSROOT}' does not exist")
endif()
endif()
endif()