Skip to content

Commit

Permalink
COMP: Consistently set use of CMake 3.9.5 and options
Browse files Browse the repository at this point in the history
cmake_minimum_required(VERSION 3.9.5 FATAL_ERROR)
foreach(p
    ## Only policies introduced after the cmake_minimum_required
    ## version 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)
  endif()
endforeach()

Change-Id: I30c9a4f2401bf83bcdb56ba89d44b24ca8342853
  • Loading branch information
hjmjohnson committed Jan 19, 2018
1 parent 85baeb6 commit 6774ad5
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 20 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.9.5 FATAL_ERROR)

foreach(p
## Only policies introduced after the cmake_minimum_required (3.8.2) need
## to explicitly be set to NEW.
## Only policies introduced after the cmake_minimum_required
## version 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.
)
Expand Down
15 changes: 11 additions & 4 deletions Examples/Installation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# This is the root ITK CMakeLists file.
cmake_minimum_required(VERSION 2.8.12)
if(COMMAND CMAKE_POLICY)
cmake_policy(SET CMP0003 NEW)
endif()
cmake_minimum_required(VERSION 3.9.5 FATAL_ERROR)
foreach(p
## Only policies introduced after the cmake_minimum_required
## version 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)
endif()
endforeach()


# This project is designed to be built outside the Insight source tree.
Expand Down
13 changes: 11 additions & 2 deletions Modules/Core/Common/CMake/itkCheckPrivateDynamicCast.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,17 @@ int main(void)
# accomplished with a custom command as a post build step for the
# compilation of the executable.
file(WRITE "${test_project_dir}/CMakeLists.txt" "
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
cmake_policy(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.9.5 FATAL_ERROR)
foreach(p
## Only policies introduced after the cmake_minimum_required
## version 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)
endif()
endforeach()
project(support_private_dynamic_cast CXX)
add_library(base SHARED \"base.cxx\")
set_target_properties(base PROPERTIES CXX_VISIBILITY_PRESET hidden)
Expand Down
13 changes: 12 additions & 1 deletion Modules/Video/BridgeOpenCV/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.9.5 FATAL_ERROR)
foreach(p
## Only policies introduced after the cmake_minimum_required
## version 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)
endif()
endforeach()

if(NOT ITK_SOURCE_DIR)
include(itk-module-init.cmake)
endif()
Expand Down
12 changes: 5 additions & 7 deletions Testing/TestExternal/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# This project builds the test directories from all ITK modules as a separate
# project outside the main ITK build tree as if they were an application.
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)

cmake_minimum_required(VERSION 3.9.5 FATAL_ERROR)
foreach(p
CMP0025 # CMake 3.0
CMP0042 # CMake 3.0
CMP0054 # CMake 3.1
CMP0056 # CMake 3.2
CMP0058 # CMake 3.3
## Only policies introduced after the cmake_minimum_required
## version 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
9 changes: 5 additions & 4 deletions Wrapping/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
#
#==========================================================================*/

cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.9.5 FATAL_ERROR)
foreach(p
CMP0025 # CMake 3.0
CMP0042 # CMake 3.0
CMP0054 # CMake 3.1
## Only policies introduced after the cmake_minimum_required
## version 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

0 comments on commit 6774ad5

Please sign in to comment.