diff options
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/CMP0135/CMP0135-Common.cmake | 18 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0135/CMP0135-NEW-stdout.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0135/CMP0135-NEW.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0135/CMP0135-OLD-stdout.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0135/CMP0135-OLD.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0135/CMP0135-WARN-stderr.txt | 10 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0135/CMP0135-WARN-stdout.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0135/CMP0135-WARN.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0135/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0135/RunCMakeTest.cmake | 5 | ||||
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/ExternalProject/Add_StepDependencies.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/ExternalProject/Add_StepDependencies_no_target.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/ExternalProject/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/ExternalProject/NO_DEPENDS-CMP0114-NEW-Direct.cmake | 1 |
15 files changed, 50 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMP0135/CMP0135-Common.cmake b/Tests/RunCMake/CMP0135/CMP0135-Common.cmake new file mode 100644 index 0000000..4b7cce5 --- /dev/null +++ b/Tests/RunCMake/CMP0135/CMP0135-Common.cmake @@ -0,0 +1,18 @@ +include(ExternalProject) + +set(stamp_dir "${CMAKE_CURRENT_BINARY_DIR}/stamps") + +ExternalProject_Add(fake_ext_proj + # We don't actually do a build, so we never try to download from this URL + URL https://example.com/something.zip + STAMP_DIR ${stamp_dir} +) + +# Report whether the --touch option was added to the extraction script +set(extraction_script "${stamp_dir}/extract-fake_ext_proj.cmake") +file(STRINGS "${extraction_script}" results REGEX "--touch") +if("${results}" STREQUAL "") + message(STATUS "Using timestamps from archive") +else() + message(STATUS "Using extraction time for the timestamps") +endif() diff --git a/Tests/RunCMake/CMP0135/CMP0135-NEW-stdout.txt b/Tests/RunCMake/CMP0135/CMP0135-NEW-stdout.txt new file mode 100644 index 0000000..bf53c0b --- /dev/null +++ b/Tests/RunCMake/CMP0135/CMP0135-NEW-stdout.txt @@ -0,0 +1 @@ +Using extraction time for the timestamps diff --git a/Tests/RunCMake/CMP0135/CMP0135-NEW.cmake b/Tests/RunCMake/CMP0135/CMP0135-NEW.cmake new file mode 100644 index 0000000..1fd6354 --- /dev/null +++ b/Tests/RunCMake/CMP0135/CMP0135-NEW.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0135 NEW) +include(CMP0135-Common.cmake) diff --git a/Tests/RunCMake/CMP0135/CMP0135-OLD-stdout.txt b/Tests/RunCMake/CMP0135/CMP0135-OLD-stdout.txt new file mode 100644 index 0000000..ee57beb --- /dev/null +++ b/Tests/RunCMake/CMP0135/CMP0135-OLD-stdout.txt @@ -0,0 +1 @@ +Using timestamps from archive diff --git a/Tests/RunCMake/CMP0135/CMP0135-OLD.cmake b/Tests/RunCMake/CMP0135/CMP0135-OLD.cmake new file mode 100644 index 0000000..80d58a7 --- /dev/null +++ b/Tests/RunCMake/CMP0135/CMP0135-OLD.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0135 OLD) +include(CMP0135-Common.cmake) diff --git a/Tests/RunCMake/CMP0135/CMP0135-WARN-stderr.txt b/Tests/RunCMake/CMP0135/CMP0135-WARN-stderr.txt new file mode 100644 index 0000000..8ba0027 --- /dev/null +++ b/Tests/RunCMake/CMP0135/CMP0135-WARN-stderr.txt @@ -0,0 +1,10 @@ +CMake Warning \(dev\) at .*/Modules/ExternalProject.cmake:[0-9]+ \(message\): + The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is + not set\. The policy's OLD behavior will be used\. When using a URL + download, the timestamps of extracted files should preferably be that of + the time of extraction, otherwise code that depends on the extracted + contents might not be rebuilt if the URL changes\. The OLD behavior + preserves the timestamps from the archive instead, but this is usually not + what you want\. Update your project to the NEW behavior or specify the + DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this + robustness issue\. diff --git a/Tests/RunCMake/CMP0135/CMP0135-WARN-stdout.txt b/Tests/RunCMake/CMP0135/CMP0135-WARN-stdout.txt new file mode 100644 index 0000000..ee57beb --- /dev/null +++ b/Tests/RunCMake/CMP0135/CMP0135-WARN-stdout.txt @@ -0,0 +1 @@ +Using timestamps from archive diff --git a/Tests/RunCMake/CMP0135/CMP0135-WARN.cmake b/Tests/RunCMake/CMP0135/CMP0135-WARN.cmake new file mode 100644 index 0000000..ab71c40 --- /dev/null +++ b/Tests/RunCMake/CMP0135/CMP0135-WARN.cmake @@ -0,0 +1,2 @@ + +include(CMP0135-Common.cmake) diff --git a/Tests/RunCMake/CMP0135/CMakeLists.txt b/Tests/RunCMake/CMP0135/CMakeLists.txt new file mode 100644 index 0000000..5ff8d3e --- /dev/null +++ b/Tests/RunCMake/CMP0135/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.23) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0135/RunCMakeTest.cmake b/Tests/RunCMake/CMP0135/RunCMakeTest.cmake new file mode 100644 index 0000000..da92391 --- /dev/null +++ b/Tests/RunCMake/CMP0135/RunCMakeTest.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +run_cmake(CMP0135-WARN) +run_cmake(CMP0135-OLD) +run_cmake(CMP0135-NEW) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index c2677a0..515c6d8 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -149,6 +149,7 @@ if("${CMAKE_C_COMPILER_ID}" STREQUAL "LCC" OR endif() add_RunCMake_test(CMP0132) +add_RunCMake_test(CMP0135) # The test for Policy 65 requires the use of the # CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS variable, which both the VS and Xcode diff --git a/Tests/RunCMake/ExternalProject/Add_StepDependencies.cmake b/Tests/RunCMake/ExternalProject/Add_StepDependencies.cmake index bfed4fa..364bf9e 100644 --- a/Tests/RunCMake/ExternalProject/Add_StepDependencies.cmake +++ b/Tests/RunCMake/ExternalProject/Add_StepDependencies.cmake @@ -4,6 +4,7 @@ if(CMAKE_XCODE_BUILD_SYSTEM VERSION_GREATER_EQUAL 12) else() cmake_policy(SET CMP0114 OLD) # Test deprecated behavior. endif() +cmake_policy(SET CMP0135 NEW) include(ExternalProject) diff --git a/Tests/RunCMake/ExternalProject/Add_StepDependencies_no_target.cmake b/Tests/RunCMake/ExternalProject/Add_StepDependencies_no_target.cmake index 039dec6..da823cd 100644 --- a/Tests/RunCMake/ExternalProject/Add_StepDependencies_no_target.cmake +++ b/Tests/RunCMake/ExternalProject/Add_StepDependencies_no_target.cmake @@ -4,6 +4,7 @@ if(CMAKE_XCODE_BUILD_SYSTEM VERSION_GREATER_EQUAL 12) else() cmake_policy(SET CMP0114 OLD) # Test deprecated behavior. endif() +cmake_policy(SET CMP0135 NEW) include(ExternalProject) diff --git a/Tests/RunCMake/ExternalProject/CMakeLists.txt b/Tests/RunCMake/ExternalProject/CMakeLists.txt index 933a57a..b94f825 100644 --- a/Tests/RunCMake/ExternalProject/CMakeLists.txt +++ b/Tests/RunCMake/ExternalProject/CMakeLists.txt @@ -3,4 +3,5 @@ project(${RunCMake_TEST} NONE) if(CMAKE_XCODE_BUILD_SYSTEM VERSION_GREATER_EQUAL 12 AND NOT RunCMake_TEST STREQUAL "Xcode-CMP0114") cmake_policy(SET CMP0114 NEW) endif() +cmake_policy(SET CMP0135 NEW) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/ExternalProject/NO_DEPENDS-CMP0114-NEW-Direct.cmake b/Tests/RunCMake/ExternalProject/NO_DEPENDS-CMP0114-NEW-Direct.cmake index 7ec1a00..e257425 100644 --- a/Tests/RunCMake/ExternalProject/NO_DEPENDS-CMP0114-NEW-Direct.cmake +++ b/Tests/RunCMake/ExternalProject/NO_DEPENDS-CMP0114-NEW-Direct.cmake @@ -1,4 +1,5 @@ cmake_policy(SET CMP0114 NEW) +cmake_policy(SET CMP0135 NEW) include(ExternalProject) ExternalProject_Add(BAR SOURCE_DIR . TEST_COMMAND echo test) ExternalProject_Add_StepTargets(BAR NO_DEPENDS test) |