mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 21:33:55 +00:00
Merge topic 'require_cmake_3_3'
314d91a5 Explicitly require CMake 3.3 and a C++11 Compiler Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !544
This commit is contained in:
commit
71b20353cd
@ -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,16 +62,11 @@ 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)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||
set(CMAKE_CXX_EXTENSIONS False)
|
||||
# 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)
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user