mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-16 17:22:55 +00:00
Explicitly require CMake 3.3 and a C++11 Compiler
We need to bump our minimum CMake version to get support for C++11 flags on certain compilers.
This commit is contained in:
parent
fa3c2b8986
commit
314d91a5f3
@ -18,25 +18,12 @@
|
||||
## this software.
|
||||
##============================================================================
|
||||
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
|
||||
#setup policy rules for CMake 3.0 while we have a minimum required of 2.8.X
|
||||
if(POLICY CMP0025)
|
||||
cmake_policy(SET CMP0025 NEW)#Clang and AppleClang are different compiler ids
|
||||
cmake_policy(SET CMP0042 NEW)#Enable RPATH on OSX
|
||||
endif()
|
||||
|
||||
#setup policy rules for CMake 3.1 while we have a minimum required of 2.8.X
|
||||
if(POLICY CMP0054)
|
||||
cmake_policy(SET CMP0053 NEW)#Enable faster parser engine
|
||||
cmake_policy(SET CMP0054 NEW)#simplify if() argument expansion
|
||||
endif()
|
||||
|
||||
#setup policy rules for CMake 3.3 while we have a minimum required of 2.8.X
|
||||
if(POLICY CMP0063)
|
||||
cmake_policy(SET CMP0058 NEW)#All dependencies on built targets are declared
|
||||
cmake_policy(SET CMP0063 NEW)#Honor visibility properties for all targets
|
||||
endif()
|
||||
#We require CMake 3.3 for Modern CMake which as features such as:
|
||||
# - Better custom command support
|
||||
# - Better acting if() argument expansion
|
||||
# - Support for usage requirements
|
||||
# -
|
||||
cmake_minimum_required(VERSION 3.3)
|
||||
|
||||
project (VTKm)
|
||||
|
||||
@ -75,13 +62,8 @@ endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Add flag to enable C++11 support.
|
||||
if (NOT CMAKE_VERSION VERSION_LESS "3.1")
|
||||
option(VTKm_ENABLE_CXX11 "Build VTKm using C++11" ON)
|
||||
else()
|
||||
set(VTKm_ENABLE_CXX11 OFF)
|
||||
endif()
|
||||
# If the user has requested C++11, propagate that information to CMake
|
||||
if (VTKm_ENABLE_CXX11)
|
||||
# Unless the user has explicitly stated to compile with a different standard
|
||||
if (NOT DEFINED CMAKE_CXX_STANDARD)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||
set(CMAKE_CXX_EXTENSIONS False)
|
||||
|
Loading…
Reference in New Issue
Block a user