Skip to content

Commit 6774ad5

Browse files
committed
COMP: Consistently set use of CMake 3.9.5 and options
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
1 parent 85baeb6 commit 6774ad5

File tree

6 files changed

+46
-20
lines changed

6 files changed

+46
-20
lines changed

CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
cmake_minimum_required(VERSION 3.9.5 FATAL_ERROR)
22

33
foreach(p
4-
## Only policies introduced after the cmake_minimum_required (3.8.2) need
5-
## to explicitly be set to NEW.
4+
## Only policies introduced after the cmake_minimum_required
5+
## version need to explicitly be set to NEW.
66
CMP0070 #3.10.0 Define ``file(GENERATE)`` behavior for relative paths.
77
CMP0071 #3.10.0 Let ``AUTOMOC`` and ``AUTOUIC`` process ``GENERATED`` files.
88
)

Examples/Installation/CMakeLists.txt

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
# This is the root ITK CMakeLists file.
2-
cmake_minimum_required(VERSION 2.8.12)
3-
if(COMMAND CMAKE_POLICY)
4-
cmake_policy(SET CMP0003 NEW)
5-
endif()
2+
cmake_minimum_required(VERSION 3.9.5 FATAL_ERROR)
3+
foreach(p
4+
## Only policies introduced after the cmake_minimum_required
5+
## version need to explicitly be set to NEW.
6+
CMP0070 #3.10.0 Define ``file(GENERATE)`` behavior for relative paths.
7+
CMP0071 #3.10.0 Let ``AUTOMOC`` and ``AUTOUIC`` process ``GENERATED`` files.
8+
)
9+
if(POLICY ${p})
10+
cmake_policy(SET ${p} NEW)
11+
endif()
12+
endforeach()
613

714

815
# This project is designed to be built outside the Insight source tree.

Modules/Core/Common/CMake/itkCheckPrivateDynamicCast.cmake

+11-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,17 @@ int main(void)
5252
# accomplished with a custom command as a post build step for the
5353
# compilation of the executable.
5454
file(WRITE "${test_project_dir}/CMakeLists.txt" "
55-
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
56-
cmake_policy(VERSION 2.8.12)
55+
cmake_minimum_required(VERSION 3.9.5 FATAL_ERROR)
56+
foreach(p
57+
## Only policies introduced after the cmake_minimum_required
58+
## version need to explicitly be set to NEW.
59+
CMP0070 #3.10.0 Define ``file(GENERATE)`` behavior for relative paths.
60+
CMP0071 #3.10.0 Let ``AUTOMOC`` and ``AUTOUIC`` process ``GENERATED`` files.
61+
)
62+
if(POLICY ${p})
63+
cmake_policy(SET ${p} NEW)
64+
endif()
65+
endforeach()
5766
project(support_private_dynamic_cast CXX)
5867
add_library(base SHARED \"base.cxx\")
5968
set_target_properties(base PROPERTIES CXX_VISIBILITY_PRESET hidden)

Modules/Video/BridgeOpenCV/CMakeLists.txt

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1-
cmake_minimum_required(VERSION 2.8.12)
1+
cmake_minimum_required(VERSION 3.9.5 FATAL_ERROR)
2+
foreach(p
3+
## Only policies introduced after the cmake_minimum_required
4+
## version need to explicitly be set to NEW.
5+
CMP0070 #3.10.0 Define ``file(GENERATE)`` behavior for relative paths.
6+
CMP0071 #3.10.0 Let ``AUTOMOC`` and ``AUTOUIC`` process ``GENERATED`` files.
7+
)
8+
if(POLICY ${p})
9+
cmake_policy(SET ${p} NEW)
10+
endif()
11+
endforeach()
12+
213
if(NOT ITK_SOURCE_DIR)
314
include(itk-module-init.cmake)
415
endif()

Testing/TestExternal/CMakeLists.txt

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# This project builds the test directories from all ITK modules as a separate
22
# project outside the main ITK build tree as if they were an application.
3-
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
4-
3+
cmake_minimum_required(VERSION 3.9.5 FATAL_ERROR)
54
foreach(p
6-
CMP0025 # CMake 3.0
7-
CMP0042 # CMake 3.0
8-
CMP0054 # CMake 3.1
9-
CMP0056 # CMake 3.2
10-
CMP0058 # CMake 3.3
5+
## Only policies introduced after the cmake_minimum_required
6+
## version need to explicitly be set to NEW.
7+
CMP0070 #3.10.0 Define ``file(GENERATE)`` behavior for relative paths.
8+
CMP0071 #3.10.0 Let ``AUTOMOC`` and ``AUTOUIC`` process ``GENERATED`` files.
119
)
1210
if(POLICY ${p})
1311
cmake_policy(SET ${p} NEW)

Wrapping/CMakeLists.txt

+5-4
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
#
1717
#==========================================================================*/
1818

19-
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
19+
cmake_minimum_required(VERSION 3.9.5 FATAL_ERROR)
2020
foreach(p
21-
CMP0025 # CMake 3.0
22-
CMP0042 # CMake 3.0
23-
CMP0054 # CMake 3.1
21+
## Only policies introduced after the cmake_minimum_required
22+
## version need to explicitly be set to NEW.
23+
CMP0070 #3.10.0 Define ``file(GENERATE)`` behavior for relative paths.
24+
CMP0071 #3.10.0 Let ``AUTOMOC`` and ``AUTOUIC`` process ``GENERATED`` files.
2425
)
2526
if(POLICY ${p})
2627
cmake_policy(SET ${p} NEW)

0 commit comments

Comments
 (0)