diff options
author | Brad King <brad.king@kitware.com> | 2022-01-19 14:06:51 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-01-19 14:06:58 (GMT) |
commit | 196243d66858a42ea9ba572e67111a2b661f0922 (patch) | |
tree | 7873103a7ec0cf01f2fcd8a169eda3c3f79264f1 /Tests/RunCMake | |
parent | 2042e0781acde4920051d5b94f57d96a20d13ad4 (diff) | |
parent | edb505921617ad2afc9acee2d246092cbaea3854 (diff) | |
download | CMake-196243d66858a42ea9ba572e67111a2b661f0922.zip CMake-196243d66858a42ea9ba572e67111a2b661f0922.tar.gz CMake-196243d66858a42ea9ba572e67111a2b661f0922.tar.bz2 |
Merge topic 'define-property-optional-args'
edb5059216 define_property(): Make BRIEF_DOCS and FULL_DOCS optional
7d26baff46 cmDefinePropertyCommand: Refactor to use cmArgumentParser
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6875
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/define_property/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/define_property/RunCMakeTest.cmake | 3 | ||||
-rw-r--r-- | Tests/RunCMake/define_property/define_property.cmake | 26 |
4 files changed, 33 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index f0457a8..dd786b8 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -418,6 +418,7 @@ add_RunCMake_test(ctest_update) add_RunCMake_test(ctest_upload) add_RunCMake_test(ctest_environment) add_RunCMake_test(ctest_fixtures) +add_RunCMake_test(define_property) add_RunCMake_test(file -DCYGWIN=${CYGWIN} -DMSYS=${MSYS}) add_RunCMake_test(file-CHMOD -DMSYS=${MSYS}) add_RunCMake_test(file-RPATH -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}) diff --git a/Tests/RunCMake/define_property/CMakeLists.txt b/Tests/RunCMake/define_property/CMakeLists.txt new file mode 100644 index 0000000..d8200fc --- /dev/null +++ b/Tests/RunCMake/define_property/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.22) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/define_property/RunCMakeTest.cmake b/Tests/RunCMake/define_property/RunCMakeTest.cmake new file mode 100644 index 0000000..5cb581b --- /dev/null +++ b/Tests/RunCMake/define_property/RunCMakeTest.cmake @@ -0,0 +1,3 @@ +include(RunCMake) + +run_cmake(define_property) diff --git a/Tests/RunCMake/define_property/define_property.cmake b/Tests/RunCMake/define_property/define_property.cmake new file mode 100644 index 0000000..d657538 --- /dev/null +++ b/Tests/RunCMake/define_property/define_property.cmake @@ -0,0 +1,26 @@ +function(assert_prop_scope_eq prop scope value) + get_property(actual_value TARGET NONE PROPERTY ${prop} ${scope}) + if(NOT actual_value STREQUAL value) + message(SEND_ERROR "Expected value of ${prop}'s ${scope}:\n ${value}\nActual value:\n ${actual_value}") + endif() +endfunction() + +define_property(TARGET PROPERTY PROP1) +define_property(TARGET PROPERTY PROP2 + BRIEF_DOCS "Brief") +define_property(TARGET PROPERTY PROP3 + FULL_DOCS "Full") +define_property(TARGET PROPERTY PROP4 + BRIEF_DOCS "Brief" + FULL_DOCS "Full") + +assert_prop_scope_eq(PROP0 BRIEF_DOCS "NOTFOUND") +assert_prop_scope_eq(PROP0 FULL_DOCS "NOTFOUND") +assert_prop_scope_eq(PROP1 BRIEF_DOCS "NOTFOUND") +assert_prop_scope_eq(PROP1 FULL_DOCS "NOTFOUND") +assert_prop_scope_eq(PROP2 BRIEF_DOCS "Brief") +assert_prop_scope_eq(PROP2 FULL_DOCS "NOTFOUND") +assert_prop_scope_eq(PROP3 BRIEF_DOCS "NOTFOUND") +assert_prop_scope_eq(PROP3 FULL_DOCS "Full") +assert_prop_scope_eq(PROP4 BRIEF_DOCS "Brief") +assert_prop_scope_eq(PROP4 FULL_DOCS "Full") |