Skip to content

Commit

Permalink
Merge topic 'UpdateToCMAKE3.9.5'
Browse files Browse the repository at this point in the history
bb0baab COMP: Directly use cmake compiler_detection.h
76dbdc5 COMP: Change min cmake version to 3.9.5 for circleci
3525bf4 ENH: Set cmake Minimums to 3.9.5
  • Loading branch information
hjmjohnson authored and kwrobot committed Jan 19, 2018
2 parents 89f848d + bb0baab commit ff69e62
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 2,761 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
sudo apt-get install -y rsync ninja-build ccache
sudo pip install --upgrade pip
sudo pip install scikit-ci-addons
ci_addons circle/install_cmake.py 3.7.2
ci_addons circle/install_cmake.py 3.9.5
- run:
name: CCache initialization
command: |
Expand Down
13 changes: 5 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.9.5 FATAL_ERROR)

foreach(p
CMP0025 # CMake 3.0
CMP0028
CMP0042 # CMake 3.0
CMP0054 # CMake 3.1
CMP0056 # CMake 3.2
CMP0058 # CMake 3.3
CMP0063 # CMake 3.3.2
## Only policies introduced after the cmake_minimum_required (3.8.2) need
## to explicitly be set to NEW.
CMP0070 #3.10.0 Define ``file(GENERATE)`` behavior for relative paths.
CMP0071 #3.10.0 Let ``AUTOMOC`` and ``AUTOUIC`` process ``GENERATED`` files.
)
if(POLICY ${p})
cmake_policy(SET ${p} NEW)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,11 @@
if( ITK_MANUAL_GENERATE_NEW_COMPILER_DETECTION_HEADERS )
# In order to provide backwards compatibility to pre-cmake 3.1.0 versions,
# the WriteCompilerDetectionHeader function should be run from a very
# recent version of cmake (i.e. 3.5.2) and the auto-generated files
# should be merged from the temporary build tree with the source
# code managed source tree. This should only be done VERY infrequently.
#
# SRCDIR=~/ITK
# BINDIR=~/ITK-bld
#
# merge files: ${CMAKE_CURRENT_BINARY_DIR}/TMP/itk_compiler_detection.h & ${SRCDIR}/Modules/Core/Common/include/itk_compiler_detection.h
# NOTE: ${SRCDIR}/Modules/Core/Common/include/itk_compiler_detection.h needs to include the custom UNKOWN compiler include stub
# merge files: ${CMAKE_CURRENT_BINARY_DIR}/TMP/compilers & ${SRCDIR}/Modules/Core/Common/include/compilers
## Dynamically create compiler detection header
include(WriteCompilerDetectionHeader)
write_compiler_detection_header(
FILE "${CMAKE_CURRENT_BINARY_DIR}/TMP/itk_compiler_detection.h"
## Dynamically create compiler detection header
include(WriteCompilerDetectionHeader)
write_compiler_detection_header(
FILE "${CMAKE_CURRENT_BINARY_DIR}/itk_compiler_detection.h"
PREFIX ITK
OUTPUT_FILES_VAR compiler_stub_headers
OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/TMP/compilers
COMPILERS AppleClang Clang GNU MSVC SunPro Intel #Supported compilers as of 3.5.2
OUTPUT_FILES_VAR ITK_compiler_detection_support_headers
OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/compilers
COMPILERS ${CMAKE_CXX_COMPILER_ID} # AppleClang Clang GNU MSVC SunPro Intel #Supported compilers as of 3.5.2
VERSION ${CMAKE_VERSION}
FEATURES
cxx_aggregate_default_initializers # Aggregate default initializers, as defined in N3605.
Expand Down Expand Up @@ -50,7 +37,7 @@ if( ITK_MANUAL_GENERATE_NEW_COMPILER_DETECTION_HEADERS )
cxx_generic_lambdas # Generic lambdas, as defined in N3649.
cxx_inheriting_constructors # Inheriting constructors, as defined in N2540.
cxx_inline_namespaces # Inline namespaces, as defined in N2535.
cxx_lambdas #Lambda functions, as defined in N2927.
cxx_lambdas # Lambda functions, as defined in N2927.
cxx_lambda_init_captures # Initialized lambda captures, as defined in N3648.
cxx_local_type_template_args # Local and unnamed types as template arguments, as defined in N2657.
cxx_long_long_type # long long type, as defined in N1811.
Expand All @@ -61,7 +48,7 @@ if( ITK_MANUAL_GENERATE_NEW_COMPILER_DETECTION_HEADERS )
cxx_range_for # Range-based for, as defined in N2930.
cxx_raw_string_literals # Raw string literals, as defined in N2442.
cxx_reference_qualified_functions # Reference qualified functions, as defined in N2439.
cxx_relaxed_constexpr #Relaxed constexpr, as defined in N3652.
cxx_relaxed_constexpr # Relaxed constexpr, as defined in N3652.
cxx_return_type_deduction # Return type deduction on normal functions, as defined in N3386.
cxx_right_angle_brackets # Right angle bracket parsing, as defined in N1757.
cxx_rvalue_references # R-value references, as defined in N2118.
Expand All @@ -78,5 +65,4 @@ if( ITK_MANUAL_GENERATE_NEW_COMPILER_DETECTION_HEADERS )
cxx_variadic_macros # Variadic macros, as defined in N1653.
cxx_variadic_templates # Variadic templates, as defined in N2242.
cxx_template_template_parameters # Template template parameters, as defined in ISO/IEC 14882:1998.
)
endif()
)
19 changes: 13 additions & 6 deletions Modules/Core/Common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,21 @@ set(ITKCommon_LIBRARIES ITKCommon)

itk_module_impl()

install(FILES
${ITKCommon_BINARY_DIR}/itkConfigure.h
DESTINATION ${ITKCommon_INSTALL_INCLUDE_DIR}
COMPONENT Development
)

# configure and install compiler feature header files
# that have fine granular support of C++11 features
# identified in a way consistent with CMake 3.1.0 and
# greater
include(CMake/itkGenerateNewCompilerFeatureDetectionHeaders.cmake)

install(FILES
${ITKCommon_BINARY_DIR}/itkConfigure.h
${CMAKE_CURRENT_BINARY_DIR}/itk_compiler_detection.h
DESTINATION ${ITKCommon_INSTALL_INCLUDE_DIR}
COMPONENT Development
)

install(FILES
${ITK_compiler_detection_support_headers}
DESTINATION ${ITKCommon_INSTALL_INCLUDE_DIR}/compilers
COMPONENT Development
)
Loading

0 comments on commit ff69e62

Please sign in to comment.