Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VTK
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Spiros Tsalikis
VTK
Commits
8a712742
Commit
8a712742
authored
7 years ago
by
Ben Boeckel
Browse files
Options
Downloads
Patches
Plain Diff
cmake: move compiler checks into its own module
parent
ebb6765c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMake/vtkCompilerChecks.cmake
+39
-0
39 additions, 0 deletions
CMake/vtkCompilerChecks.cmake
CMakeLists.txt
+1
-45
1 addition, 45 deletions
CMakeLists.txt
with
40 additions
and
45 deletions
CMake/vtkCompilerChecks.cmake
0 → 100644
+
39
−
0
View file @
8a712742
# Minimum compiler version check: GCC >= 4.8
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"GNU"
AND
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8
)
message
(
FATAL_ERROR
"GCC 4.8 or later is required."
)
endif
()
# Minimum compiler version check: LLVM Clang >= 3.3
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"Clang"
AND
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.3
)
message
(
FATAL_ERROR
"LLVM Clang 3.3 or later is required."
)
endif
()
# Minimum compiler version check: Apple Clang >= 5.0 (Xcode 5.0)
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"AppleClang"
AND
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0
)
message
(
FATAL_ERROR
"Apple Clang 5.0 or later is required."
)
endif
()
# Minimum compiler version check: Microsoft C/C++ >= 18.0 (aka VS 2013 aka VS 12.0)
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"MSVC"
AND
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0
)
message
(
FATAL_ERROR
"Microsoft Visual Studio 2013 or later is required."
)
endif
()
# Minimum compiler version check: Intel C++ (ICC) >= 14
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"Intel"
AND
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14.0
)
message
(
FATAL_ERROR
"Intel C++ (ICC) 14.0 or later is required."
)
endif
()
# Make sure we have C++11 enabled.
if
(
NOT VTK_IGNORE_CMAKE_CXX11_CHECKS
)
# Needed to make sure libraries and executables not built by the
# vtkModuleMacros still have the C++11 compiler flags enabled
# Wrap this in an escape hatch for unknown compilers
set
(
CMAKE_CXX_STANDARD 11
)
set
(
CMAKE_CXX_STANDARD_REQUIRED True
)
set
(
CMAKE_CXX_EXTENSIONS False
)
endif
()
This diff is collapsed.
Click to expand it.
CMakeLists.txt
+
1
−
45
View file @
8a712742
...
...
@@ -9,51 +9,7 @@ project(VTK)
set
(
VTK_CMAKE_DIR
"
${
VTK_SOURCE_DIR
}
/CMake"
)
set
(
CMAKE_MODULE_PATH
${
VTK_CMAKE_DIR
}
${
CMAKE_MODULE_PATH
}
)
#-----------------------------------------------------------------------------
# Minimum compiler version check: GCC >= 4.8
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"GNU"
AND
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8
)
message
(
FATAL_ERROR
"GCC 4.8 or later is required."
)
endif
()
#-----------------------------------------------------------------------------
# Minimum compiler version check: LLVM Clang >= 3.3
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"Clang"
AND
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.3
)
message
(
FATAL_ERROR
"LLVM Clang 3.3 or later is required."
)
endif
()
#-----------------------------------------------------------------------------
# Minimum compiler version check: Apple Clang >= 5.0 (Xcode 5.0)
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"AppleClang"
AND
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0
)
message
(
FATAL_ERROR
"Apple Clang 5.0 or later is required."
)
endif
()
#-----------------------------------------------------------------------------
# Minimum compiler version check: Microsoft C/C++ >= 18.0 (aka VS 2013 aka VS 12.0)
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"MSVC"
AND
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0
)
message
(
FATAL_ERROR
"Microsoft Visual Studio 2013 or later is required."
)
endif
()
#-----------------------------------------------------------------------------
# Minimum compiler version check: Intel C++ (ICC) >= 14
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"Intel"
AND
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14.0
)
message
(
FATAL_ERROR
"Intel C++ (ICC) 14.0 or later is required."
)
endif
()
# Make sure we have C++11 enabled.
if
(
NOT VTK_IGNORE_CMAKE_CXX11_CHECKS
)
# Needed to make sure libraries and executables not built by the
# vtkModuleMacros still have the C++11 compiler flags enabled
# Wrap this in an escape hatch for unknown compilers
set
(
CMAKE_CXX_STANDARD 11
)
set
(
CMAKE_CXX_STANDARD_REQUIRED True
)
set
(
CMAKE_CXX_EXTENSIONS False
)
endif
()
include
(
vtkCompilerChecks
)
# Objective-C++ compile flags.
# CMake has no equivalent of CMAKE_CXX_FLAGS for Objective-C++ (bug #4756)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment