From a8cf033a74d367c61f6aaa7ea01e70c5391a5376 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 13 Dec 2024 14:55:34 -0500 Subject: Tests/RunCMake/return: Use newer cmake_minimum_required VERSION --- Tests/RunCMake/return/CMP0140-WARN.cmake | 3 --- Tests/RunCMake/return/CMakeLists.txt | 5 ++++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Tests/RunCMake/return/CMP0140-WARN.cmake b/Tests/RunCMake/return/CMP0140-WARN.cmake index df2fc88..79a4572 100644 --- a/Tests/RunCMake/return/CMP0140-WARN.cmake +++ b/Tests/RunCMake/return/CMP0140-WARN.cmake @@ -1,6 +1,3 @@ - -cmake_policy(VERSION 3.1) - function(FUNC) return(PROPAGATE VAR) endfunction() diff --git a/Tests/RunCMake/return/CMakeLists.txt b/Tests/RunCMake/return/CMakeLists.txt index 6cc903f..915e8e3 100644 --- a/Tests/RunCMake/return/CMakeLists.txt +++ b/Tests/RunCMake/return/CMakeLists.txt @@ -1,3 +1,6 @@ -cmake_minimum_required(VERSION 3.1...3.25) +cmake_minimum_required(VERSION 3.25) +if(RunCMake_TEST MATCHES "^CMP0140") + cmake_minimum_required(VERSION 3.24) +endif() project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) -- cgit v0.12 From 0eca249ac71587a2c670b9d8a9312202038b953d Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 27 Nov 2024 17:21:57 -0500 Subject: Tests/RunCMake: Update more cmake_minimum_required versions to 3.10 These were missed in commit f4aa34daa7 (Tests/RunCMake: Update cmake_minimum_required versions to 3.10, 2024-10-02, v3.31.0-rc1~23^2~2). --- Tests/RunCMake/Policy/CMakeLists.txt | 2 +- Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Tests/RunCMake/Policy/CMakeLists.txt b/Tests/RunCMake/Policy/CMakeLists.txt index 667561e..30c0273 100644 --- a/Tests/RunCMake/Policy/CMakeLists.txt +++ b/Tests/RunCMake/Policy/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.10) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE) diff --git a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake index 1bcebb8..80be692 100644 --- a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake @@ -1,5 +1,4 @@ include(RunCMake) -set(RunCMake_IGNORE_POLICY_VERSION_DEPRECATION ON) if(RunCMake_GENERATOR_IS_MULTI_CONFIG) set(RunCMake_TEST_OPTIONS -DCMAKE_CONFIGURATION_TYPES=Debug) -- cgit v0.12 From 9ffbc0e6287a19e38d1e03481db4b57b95caa056 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 9 Dec 2024 19:27:32 -0500 Subject: Tests/RunCMake/cmake_minimum_required: Generalize deprecated version case name --- .../cmake_minimum_required/Before3_10-stderr.txt | 29 ---------------------- .../cmake_minimum_required/Before3_10.cmake | 6 ----- .../BeforeVersionDeprecated-stderr.txt | 29 ++++++++++++++++++++++ .../BeforeVersionDeprecated.cmake | 6 +++++ .../cmake_minimum_required/RunCMakeTest.cmake | 2 +- 5 files changed, 36 insertions(+), 36 deletions(-) delete mode 100644 Tests/RunCMake/cmake_minimum_required/Before3_10-stderr.txt delete mode 100644 Tests/RunCMake/cmake_minimum_required/Before3_10.cmake create mode 100644 Tests/RunCMake/cmake_minimum_required/BeforeVersionDeprecated-stderr.txt create mode 100644 Tests/RunCMake/cmake_minimum_required/BeforeVersionDeprecated.cmake diff --git a/Tests/RunCMake/cmake_minimum_required/Before3_10-stderr.txt b/Tests/RunCMake/cmake_minimum_required/Before3_10-stderr.txt deleted file mode 100644 index 4a6842b..0000000 --- a/Tests/RunCMake/cmake_minimum_required/Before3_10-stderr.txt +++ /dev/null @@ -1,29 +0,0 @@ -^CMake Deprecation Warning at Before3_10\.cmake:1 \(cmake_minimum_required\): - Compatibility with CMake < 3\.10 will be removed from a future version of - CMake\. - - Update the VERSION argument value\. Or, use the \.\.\. syntax - to tell CMake that the project requires at least but has been updated - to work with policies introduced by or earlier\. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -+ -CMake Deprecation Warning at Before3_10\.cmake:2 \(cmake_policy\): - Compatibility with CMake < 3\.10 will be removed from a future version of - CMake\. - - Update the VERSION argument value\. Or, use the \.\.\. syntax - to tell CMake that the project requires at least but has been updated - to work with policies introduced by or earlier\. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -+ -CMake Deprecation Warning at Before3_10\.cmake:6 \(cmake_policy\): - Compatibility with CMake < 3\.10 will be removed from a future version of - CMake\. - - Update the VERSION argument value\. Or, use the \.\.\. syntax - to tell CMake that the project requires at least but has been updated - to work with policies introduced by or earlier\. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/cmake_minimum_required/Before3_10.cmake b/Tests/RunCMake/cmake_minimum_required/Before3_10.cmake deleted file mode 100644 index 0b010ef..0000000 --- a/Tests/RunCMake/cmake_minimum_required/Before3_10.cmake +++ /dev/null @@ -1,6 +0,0 @@ -cmake_minimum_required(VERSION 3.9) -cmake_policy(VERSION 2.6) -cmake_policy(PUSH) -cmake_policy(VERSION 2.6) # simulate pre-3.18 install(EXPORT)-generated call -cmake_policy(POP) -cmake_policy(VERSION 3.9) diff --git a/Tests/RunCMake/cmake_minimum_required/BeforeVersionDeprecated-stderr.txt b/Tests/RunCMake/cmake_minimum_required/BeforeVersionDeprecated-stderr.txt new file mode 100644 index 0000000..5af7abb --- /dev/null +++ b/Tests/RunCMake/cmake_minimum_required/BeforeVersionDeprecated-stderr.txt @@ -0,0 +1,29 @@ +^CMake Deprecation Warning at BeforeVersionDeprecated\.cmake:1 \(cmake_minimum_required\): + Compatibility with CMake < 3\.10 will be removed from a future version of + CMake\. + + Update the VERSION argument value\. Or, use the \.\.\. syntax + to tell CMake that the project requires at least but has been updated + to work with policies introduced by or earlier\. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Deprecation Warning at BeforeVersionDeprecated\.cmake:2 \(cmake_policy\): + Compatibility with CMake < 3\.10 will be removed from a future version of + CMake\. + + Update the VERSION argument value\. Or, use the \.\.\. syntax + to tell CMake that the project requires at least but has been updated + to work with policies introduced by or earlier\. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Deprecation Warning at BeforeVersionDeprecated\.cmake:6 \(cmake_policy\): + Compatibility with CMake < 3\.10 will be removed from a future version of + CMake\. + + Update the VERSION argument value\. Or, use the \.\.\. syntax + to tell CMake that the project requires at least but has been updated + to work with policies introduced by or earlier\. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/cmake_minimum_required/BeforeVersionDeprecated.cmake b/Tests/RunCMake/cmake_minimum_required/BeforeVersionDeprecated.cmake new file mode 100644 index 0000000..0b010ef --- /dev/null +++ b/Tests/RunCMake/cmake_minimum_required/BeforeVersionDeprecated.cmake @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.9) +cmake_policy(VERSION 2.6) +cmake_policy(PUSH) +cmake_policy(VERSION 2.6) # simulate pre-3.18 install(EXPORT)-generated call +cmake_policy(POP) +cmake_policy(VERSION 3.9) diff --git a/Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake b/Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake index 2851c72..6de792e 100644 --- a/Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake +++ b/Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake @@ -4,7 +4,7 @@ run_cmake(Before24) run_cmake(CompatBefore24) run_cmake(Future) run_cmake(PolicyBefore24) -run_cmake(Before3_10) +run_cmake(BeforeVersionDeprecated) run_cmake(Range) run_cmake(RangeBad) run_cmake(Unknown) -- cgit v0.12 From 5e9b40b6a5862dad8e6adb5db87149a030dffe45 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 29 Nov 2024 11:37:13 -0500 Subject: Help: Update cmake-buildsystem(7) TARGET_POLICY example to a newer policy --- Help/manual/cmake-buildsystem.7.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Help/manual/cmake-buildsystem.7.rst b/Help/manual/cmake-buildsystem.7.rst index 391ba53..d363485 100644 --- a/Help/manual/cmake-buildsystem.7.rst +++ b/Help/manual/cmake-buildsystem.7.rst @@ -960,20 +960,20 @@ on the consumer: target_compile_definitions(lib1 INTERFACE $<$,EXECUTABLE>:LIB1_WITH_EXE> $<$,SHARED_LIBRARY>:LIB1_WITH_SHARED_LIB> - $<$:CONSUMER_CMP0041_NEW> + $<$:CONSUMER_CMP0182_NEW> ) add_executable(exe1 exe1.cpp) target_link_libraries(exe1 lib1) - cmake_policy(SET CMP0041 NEW) + cmake_policy(SET CMP0182 NEW) add_library(shared_lib shared_lib.cpp) target_link_libraries(shared_lib lib1) The ``exe1`` executable will be compiled with ``-DLIB1_WITH_EXE``, while the ``shared_lib`` shared library will be compiled with ``-DLIB1_WITH_SHARED_LIB`` -and ``-DCONSUMER_CMP0041_NEW``, because policy :policy:`CMP0041` is +and ``-DCONSUMER_CMP0182_NEW``, because policy :policy:`CMP0182` is ``NEW`` at the point where the ``shared_lib`` target is created. The ``BUILD_INTERFACE`` expression wraps requirements which are only used when -- cgit v0.12 From b010a1fb1d7ef43e7059998c8bad1aff9899cd80 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 13 Dec 2024 14:15:33 -0500 Subject: Help: Update try_compile list of automatic policies --- Help/command/try_compile.rst | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Help/command/try_compile.rst b/Help/command/try_compile.rst index 8ecfd36..c0ebe1d 100644 --- a/Help/command/try_compile.rst +++ b/Help/command/try_compile.rst @@ -335,8 +335,21 @@ Other Behavior Settings :module:`CheckPIESupported` module must be called before using the ``try_compile`` command. -The current settings of :policy:`CMP0065` and :policy:`CMP0083` are propagated -through to the generated test project. +Some policies are set automatically in the generated test project +as needed to honor the state of the calling project: + +* :policy:`CMP0065` +* :policy:`CMP0083` +* :policy:`CMP0091` +* :policy:`CMP0104` +* :policy:`CMP0123` +* :policy:`CMP0126` +* :policy:`CMP0128` +* :policy:`CMP0136` +* :policy:`CMP0141` +* :policy:`CMP0155` +* :policy:`CMP0157` +* :policy:`CMP0181` .. versionadded:: 3.32 The current setting of :policy:`CMP0181` policy is propagated through to the -- cgit v0.12