diff options
author | Brad King <brad.king@kitware.com> | 2024-01-24 13:38:50 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2024-01-24 13:39:09 (GMT) |
commit | 73b76563fb40d88ac3b6dd7ad14e1658f3910a5e (patch) | |
tree | 5cc62631b2e5b732a062b004cdd1e80b6bacc35f /Tests/RunCMake | |
parent | 31cdde5ce8ec30e4ad34cb53e3d92f45539ea554 (diff) | |
parent | 0cfd8fe8ad01f05ba95f51c4d6ce2f8774de3f5c (diff) | |
download | CMake-73b76563fb40d88ac3b6dd7ad14e1658f3910a5e.zip CMake-73b76563fb40d88ac3b6dd7ad14e1658f3910a5e.tar.gz CMake-73b76563fb40d88ac3b6dd7ad14e1658f3910a5e.tar.bz2 |
Merge topic 'validate_read-only_target_properties'
0cfd8fe8ad cmTarget: Don't allow setting read-only properties
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9133
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/CMP0160/CMP0160-NEW-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0160/CMP0160-NEW-stderr.txt | 233 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0160/CMP0160-NEW.cmake | 4 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0160/CMP0160-OLD-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0160/CMP0160-OLD-stderr.txt | 104 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0160/CMP0160-OLD.cmake | 4 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0160/CMP0160-WARN-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0160/CMP0160-WARN-stderr.txt | 297 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0160/CMP0160-WARN.cmake | 3 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0160/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0160/READONLY_PROPERTIES.cmake | 52 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0160/RunCMakeTest.cmake | 5 | ||||
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/set_property/IMPORTED_GLOBAL-stderr.txt | 4 | ||||
-rw-r--r-- | Tests/RunCMake/target_sources/FileSetReadOnlyInterface-stderr.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/target_sources/FileSetReadOnlyPrivate-stderr.txt | 2 |
17 files changed, 714 insertions, 4 deletions
diff --git a/Tests/RunCMake/CMP0160/CMP0160-NEW-result.txt b/Tests/RunCMake/CMP0160/CMP0160-NEW-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMP0160/CMP0160-NEW-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMP0160/CMP0160-NEW-stderr.txt b/Tests/RunCMake/CMP0160/CMP0160-NEW-stderr.txt new file mode 100644 index 0000000..b52b633 --- /dev/null +++ b/Tests/RunCMake/CMP0160/CMP0160-NEW-stderr.txt @@ -0,0 +1,233 @@ +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + HEADER_SETS property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + INTERFACE_HEADER_SETS property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + MANUALLY_ADDED_DEPENDENCIES property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + NAME property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + TYPE property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + ALIAS_GLOBAL property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + BINARY_DIR property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + CXX_MODULE_SETS property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + IMPORTED property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + INTERFACE_CXX_MODULE_SETS property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + LOCATION property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + LOCATION_CONFIG property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + SOURCE_DIR property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + IMPORTED_GLOBAL property can't be set on non-imported + targets\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + HEADER_SETS property is read-only for target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + INTERFACE_HEADER_SETS property is read-only for target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + MANUALLY_ADDED_DEPENDENCIES property is read-only for + target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + NAME property is read-only for target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + TYPE property is read-only for target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + ALIAS_GLOBAL property is read-only for target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + BINARY_DIR property is read-only for target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + CXX_MODULE_SETS property is read-only for target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + IMPORTED property is read-only for target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + INTERFACE_CXX_MODULE_SETS property is read-only for + target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + LOCATION property is read-only for target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + LOCATION_CONFIG property is read-only for target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + SOURCE_DIR property is read-only for target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + EXPORT_NAME property can't be set on imported targets\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + SOURCES property can't be set on imported targets\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-NEW.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CMP0160/CMP0160-NEW.cmake b/Tests/RunCMake/CMP0160/CMP0160-NEW.cmake new file mode 100644 index 0000000..ed3a256 --- /dev/null +++ b/Tests/RunCMake/CMP0160/CMP0160-NEW.cmake @@ -0,0 +1,4 @@ + +project(ReadOnly LANGUAGES NONE) +cmake_policy(SET CMP0160 NEW) +include(${CMAKE_CURRENT_LIST_DIR}/READONLY_PROPERTIES.cmake) diff --git a/Tests/RunCMake/CMP0160/CMP0160-OLD-result.txt b/Tests/RunCMake/CMP0160/CMP0160-OLD-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMP0160/CMP0160-OLD-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMP0160/CMP0160-OLD-stderr.txt b/Tests/RunCMake/CMP0160/CMP0160-OLD-stderr.txt new file mode 100644 index 0000000..e57cd9d --- /dev/null +++ b/Tests/RunCMake/CMP0160/CMP0160-OLD-stderr.txt @@ -0,0 +1,104 @@ +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + HEADER_SETS property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-OLD.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + INTERFACE_HEADER_SETS property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-OLD.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + MANUALLY_ADDED_DEPENDENCIES property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-OLD.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + NAME property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-OLD.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + TYPE property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-OLD.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + IMPORTED_GLOBAL property can't be set on non-imported + targets\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-OLD.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + HEADER_SETS property is read-only for target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-OLD.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + INTERFACE_HEADER_SETS property is read-only for target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-OLD.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + MANUALLY_ADDED_DEPENDENCIES property is read-only for + target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-OLD.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + NAME property is read-only for target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-OLD.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + TYPE property is read-only for target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-OLD.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + EXPORT_NAME property can't be set on imported targets\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-OLD.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + SOURCES property can't be set on imported targets\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-OLD.cmake:4 \(include\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CMP0160/CMP0160-OLD.cmake b/Tests/RunCMake/CMP0160/CMP0160-OLD.cmake new file mode 100644 index 0000000..6c6f1f8 --- /dev/null +++ b/Tests/RunCMake/CMP0160/CMP0160-OLD.cmake @@ -0,0 +1,4 @@ + +project(ReadOnly LANGUAGES NONE) +cmake_policy(SET CMP0160 OLD) +include(${CMAKE_CURRENT_LIST_DIR}/READONLY_PROPERTIES.cmake) diff --git a/Tests/RunCMake/CMP0160/CMP0160-WARN-result.txt b/Tests/RunCMake/CMP0160/CMP0160-WARN-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMP0160/CMP0160-WARN-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMP0160/CMP0160-WARN-stderr.txt b/Tests/RunCMake/CMP0160/CMP0160-WARN-stderr.txt new file mode 100644 index 0000000..b15104e --- /dev/null +++ b/Tests/RunCMake/CMP0160/CMP0160-WARN-stderr.txt @@ -0,0 +1,297 @@ +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + HEADER_SETS property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + INTERFACE_HEADER_SETS property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + MANUALLY_ADDED_DEPENDENCIES property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + NAME property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + TYPE property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + Policy CMP0160 is not set: More read-only target properties now error when + trying to set them. Run "cmake --help-policy CMP0160" for policy details. + Use the cmake_policy command to set the policy and suppress this warning. + + ALIAS_GLOBAL property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + Policy CMP0160 is not set: More read-only target properties now error when + trying to set them. Run "cmake --help-policy CMP0160" for policy details. + Use the cmake_policy command to set the policy and suppress this warning. + + BINARY_DIR property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + Policy CMP0160 is not set: More read-only target properties now error when + trying to set them. Run "cmake --help-policy CMP0160" for policy details. + Use the cmake_policy command to set the policy and suppress this warning. + + CXX_MODULE_SETS property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + Policy CMP0160 is not set: More read-only target properties now error when + trying to set them. Run "cmake --help-policy CMP0160" for policy details. + Use the cmake_policy command to set the policy and suppress this warning. + + IMPORTED property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + Policy CMP0160 is not set: More read-only target properties now error when + trying to set them. Run "cmake --help-policy CMP0160" for policy details. + Use the cmake_policy command to set the policy and suppress this warning. + + INTERFACE_CXX_MODULE_SETS property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + Policy CMP0160 is not set: More read-only target properties now error when + trying to set them. Run "cmake --help-policy CMP0160" for policy details. + Use the cmake_policy command to set the policy and suppress this warning. + + LOCATION property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + Policy CMP0160 is not set: More read-only target properties now error when + trying to set them. Run "cmake --help-policy CMP0160" for policy details. + Use the cmake_policy command to set the policy and suppress this warning. + + LOCATION_CONFIG property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + Policy CMP0160 is not set: More read-only target properties now error when + trying to set them. Run "cmake --help-policy CMP0160" for policy details. + Use the cmake_policy command to set the policy and suppress this warning. + + SOURCE_DIR property is read-only for target\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + IMPORTED_GLOBAL property can't be set on non-imported + targets\("ReadOnlyLib"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + HEADER_SETS property is read-only for target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + INTERFACE_HEADER_SETS property is read-only for target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + MANUALLY_ADDED_DEPENDENCIES property is read-only for + target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + NAME property is read-only for target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + TYPE property is read-only for target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + Policy CMP0160 is not set: More read-only target properties now error when + trying to set them. Run "cmake --help-policy CMP0160" for policy details. + Use the cmake_policy command to set the policy and suppress this warning. + + ALIAS_GLOBAL property is read-only for target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + Policy CMP0160 is not set: More read-only target properties now error when + trying to set them. Run "cmake --help-policy CMP0160" for policy details. + Use the cmake_policy command to set the policy and suppress this warning. + + BINARY_DIR property is read-only for target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + Policy CMP0160 is not set: More read-only target properties now error when + trying to set them. Run "cmake --help-policy CMP0160" for policy details. + Use the cmake_policy command to set the policy and suppress this warning. + + CXX_MODULE_SETS property is read-only for target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + Policy CMP0160 is not set: More read-only target properties now error when + trying to set them. Run "cmake --help-policy CMP0160" for policy details. + Use the cmake_policy command to set the policy and suppress this warning. + + IMPORTED property is read-only for target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + Policy CMP0160 is not set: More read-only target properties now error when + trying to set them. Run "cmake --help-policy CMP0160" for policy details. + Use the cmake_policy command to set the policy and suppress this warning. + + INTERFACE_CXX_MODULE_SETS property is read-only for + target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + Policy CMP0160 is not set: More read-only target properties now error when + trying to set them. Run "cmake --help-policy CMP0160" for policy details. + Use the cmake_policy command to set the policy and suppress this warning. + + LOCATION property is read-only for target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + Policy CMP0160 is not set: More read-only target properties now error when + trying to set them. Run "cmake --help-policy CMP0160" for policy details. + Use the cmake_policy command to set the policy and suppress this warning. + + LOCATION_CONFIG property is read-only for target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + Policy CMP0160 is not set: More read-only target properties now error when + trying to set them. Run "cmake --help-policy CMP0160" for policy details. + Use the cmake_policy command to set the policy and suppress this warning. + + SOURCE_DIR property is read-only for target\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + EXPORT_NAME property can't be set on imported targets\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) + + +CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\): + SOURCES property can't be set on imported targets\("ReadOnlyImport"\) + +Call Stack \(most recent call first\): + CMP0160-WARN.cmake:3 \(include\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CMP0160/CMP0160-WARN.cmake b/Tests/RunCMake/CMP0160/CMP0160-WARN.cmake new file mode 100644 index 0000000..e9e99bb --- /dev/null +++ b/Tests/RunCMake/CMP0160/CMP0160-WARN.cmake @@ -0,0 +1,3 @@ + +project(ReadOnly LANGUAGES NONE) +include(${CMAKE_CURRENT_LIST_DIR}/READONLY_PROPERTIES.cmake) diff --git a/Tests/RunCMake/CMP0160/CMakeLists.txt b/Tests/RunCMake/CMP0160/CMakeLists.txt new file mode 100644 index 0000000..6a9ce76 --- /dev/null +++ b/Tests/RunCMake/CMP0160/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.28) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0160/READONLY_PROPERTIES.cmake b/Tests/RunCMake/CMP0160/READONLY_PROPERTIES.cmake new file mode 100644 index 0000000..07bbe78 --- /dev/null +++ b/Tests/RunCMake/CMP0160/READONLY_PROPERTIES.cmake @@ -0,0 +1,52 @@ + +set(read_only_properties + "HEADER_SETS" + "INTERFACE_HEADER_SETS" + "MANUALLY_ADDED_DEPENDENCIES" + "NAME" + "TYPE" + ) +set(read_only_properties_imported + "EXPORT_NAME" + "SOURCES" + ) +set(read_only_properties_nonimported + "IMPORTED_GLOBAL" + ) +set(read_only_properties_160 + "ALIAS_GLOBAL" + "BINARY_DIR" + "CXX_MODULE_SETS" + "IMPORTED" + "INTERFACE_CXX_MODULE_SETS" + "LOCATION" + "LOCATION_CONFIG" + "SOURCE_DIR" + ) + +cmake_policy(GET CMP0160 policy160) +add_library(ReadOnlyLib ) +add_library(ReadOnlyImport IMPORTED UNKNOWN) + +foreach(target ReadOnlyLib ReadOnlyImport) + get_target_property(is_imported ${target} IMPORTED) + set(are_read_only ${read_only_properties}) + if(NOT policy160 STREQUAL "OLD") + list(APPEND are_read_only ${read_only_properties_160}) + endif() + if(is_imported) + list(APPEND are_read_only ${read_only_properties_imported}) + else() + list(APPEND are_read_only ${read_only_properties_nonimported}) + endif() + + foreach(prop IN LISTS are_read_only) + set_target_properties(${target} PROPERTIES ${prop} "a_value") + endforeach() + + if(policy160 STREQUAL "OLD") + foreach(prop IN LISTS read_only_properties_160) + set_target_properties(${target} PROPERTIES ${prop} "a_value") + endforeach() + endif() +endforeach() diff --git a/Tests/RunCMake/CMP0160/RunCMakeTest.cmake b/Tests/RunCMake/CMP0160/RunCMakeTest.cmake new file mode 100644 index 0000000..60380b5 --- /dev/null +++ b/Tests/RunCMake/CMP0160/RunCMakeTest.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +run_cmake(CMP0160-WARN) +run_cmake(CMP0160-OLD) +run_cmake(CMP0160-NEW) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index ef088aa..4aad417 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -168,6 +168,7 @@ endif() add_RunCMake_test(CMP0153) add_RunCMake_test(CMP0156 -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID} -DCMAKE_C_COMPILER_VERSION=${CMAKE_C_COMPILER_VERSION}) +add_RunCMake_test(CMP0160) # 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/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt index 11d59b7..6b462d0 100644 --- a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt +++ b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt @@ -41,6 +41,7 @@ \* CMP0155 \* CMP0156 \* CMP0157 + \* CMP0160 Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/set_property/IMPORTED_GLOBAL-stderr.txt b/Tests/RunCMake/set_property/IMPORTED_GLOBAL-stderr.txt index e45fc64..8f575b5 100644 --- a/Tests/RunCMake/set_property/IMPORTED_GLOBAL-stderr.txt +++ b/Tests/RunCMake/set_property/IMPORTED_GLOBAL-stderr.txt @@ -23,8 +23,8 @@ Call Stack \(most recent call first\): CMake Error at IMPORTED_GLOBAL.cmake:32 \(set_property\): - IMPORTED_GLOBAL property can't be set on non-imported targets - \(\"NonImportedTarget\"\) + IMPORTED_GLOBAL property can't be set on non-imported + targets\(\"NonImportedTarget\"\) Call Stack \(most recent call first\): CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/target_sources/FileSetReadOnlyInterface-stderr.txt b/Tests/RunCMake/target_sources/FileSetReadOnlyInterface-stderr.txt index 2307d13..50901fe 100644 --- a/Tests/RunCMake/target_sources/FileSetReadOnlyInterface-stderr.txt +++ b/Tests/RunCMake/target_sources/FileSetReadOnlyInterface-stderr.txt @@ -1,5 +1,5 @@ ^CMake Error at FileSetReadOnlyInterface\.cmake:[0-9]+ \(set_property\): - INTERFACE_HEADER_SETS property is read-only + INTERFACE_HEADER_SETS property is read-only for target\("lib1"\) Call Stack \(most recent call first\): CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/target_sources/FileSetReadOnlyPrivate-stderr.txt b/Tests/RunCMake/target_sources/FileSetReadOnlyPrivate-stderr.txt index 5f955da..4767894 100644 --- a/Tests/RunCMake/target_sources/FileSetReadOnlyPrivate-stderr.txt +++ b/Tests/RunCMake/target_sources/FileSetReadOnlyPrivate-stderr.txt @@ -1,5 +1,5 @@ ^CMake Error at FileSetReadOnlyPrivate\.cmake:[0-9]+ \(set_property\): - HEADER_SETS property is read-only + HEADER_SETS property is read-only for target\("lib1"\) Call Stack \(most recent call first\): CMakeLists\.txt:[0-9]+ \(include\)$ |