forked from Slicer/Slicer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSlicerBlockPlatformCheck.cmake
56 lines (52 loc) · 1.95 KB
/
SlicerBlockPlatformCheck.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
################################################################################
#
# 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
#
################################################################################
#
# Slicer Platform check
#
#
# Usage:
# The check can be enabled/disabled by setting Slicer_PLATFORM_CHECK to
# True/False before including the block.
#
if(NOT DEFINED Slicer_PLATFORM_CHECK)
set(Slicer_PLATFORM_CHECK true)
endif()
if(Slicer_PLATFORM_CHECK)
if(WIN32)
# See https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html
# and https://en.wikipedia.org/wiki/Microsoft_Visual_Studio#Version_history
# 1920-1929 = VS 16.0 (v142 toolset)
# 1930-1949 = VS 17.0 (v143 toolset, see https://devblogs.microsoft.com/cppblog/msvc-toolset-minor-version-number-14-40-in-vs-2022-v17-10/)
if(NOT MSVC_VERSION VERSION_GREATER_EQUAL 1920)
message(FATAL_ERROR "Microsoft Visual C/C++ toolset 142 or newer is required !")
endif()
elseif(APPLE)
# See CMake/Modules/Platform/Darwin.cmake)
# and https://en.wikipedia.org/wiki/Darwin_(operating_system)#Release_history
# 22.x == macOS 13 (Ventura)
# 23.x == macOS 14 (Sonoma)
# 24.x == macOS 15 (Sequoia)
if(NOT DARWIN_MAJOR_VERSION GREATER_EQUAL "22")
message(FATAL_ERROR "Only macOS >= 13 is supported !")
endif()
# elseif(UNIX)
# No UNIX platform checks currently
endif()
endif()