This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, next has been updated via fb08194fa34fa33379de6c01cf72278d1da4bf90 (commit) via 9ec446a86e5049ead95f35208f8844a5b1c817d5 (commit) via 95b3b096474932430f04433fc61a422239333b02 (commit) via bfc4b17aeb9fa6d2843f655052ac2c1a563bc25f (commit) via 5008f9da62218ba204dc0f1161d8ef39307fe061 (commit) from 7f218113baea90ff726b2f72be85242d038a60ba (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fb08194fa34fa33379de6c01cf72278d1da4bf90 commit fb08194fa34fa33379de6c01cf72278d1da4bf90 Merge: 7f21811 9ec446a Author: Ben Boeckel <ben.boec...@kitware.com> AuthorDate: Thu Jan 8 16:55:37 2015 -0500 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Thu Jan 8 16:55:37 2015 -0500 Merge topic 'fix-empty-target-property-queries' into next 9ec446a8 tests: add tests for querying properties 95b3b096 set_tests_properties: fix documentation bfc4b17a get_test_property: clarify the documentation 5008f9da cmGetTargetPropertyCommand: discern empty from undefined properties http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9ec446a86e5049ead95f35208f8844a5b1c817d5 commit 9ec446a86e5049ead95f35208f8844a5b1c817d5 Author: Ben Boeckel <ben.boec...@kitware.com> AuthorDate: Thu Jan 8 15:27:46 2015 -0500 Commit: Ben Boeckel <ben.boec...@kitware.com> CommitDate: Thu Jan 8 16:33:31 2015 -0500 tests: add tests for querying properties diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index b5e41d9..05c51cc 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -173,3 +173,4 @@ add_RunCMake_test(CommandLine) add_RunCMake_test(install) add_RunCMake_test(CPackInstallProperties) add_RunCMake_test(ExternalProject) +add_RunCMake_test(get_property) diff --git a/Tests/RunCMake/get_property/CMakeLists.txt b/Tests/RunCMake/get_property/CMakeLists.txt new file mode 100644 index 0000000..12cd3c7 --- /dev/null +++ b/Tests/RunCMake/get_property/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/get_property/RunCMakeTest.cmake b/Tests/RunCMake/get_property/RunCMakeTest.cmake new file mode 100644 index 0000000..e5700a2 --- /dev/null +++ b/Tests/RunCMake/get_property/RunCMakeTest.cmake @@ -0,0 +1,9 @@ +include(RunCMake) + +#run_cmake(cache_properties) +run_cmake(directory_properties) +run_cmake(global_properties) +run_cmake(install_properties) +run_cmake(source_properties) +run_cmake(target_properties) +run_cmake(test_properties) diff --git a/Tests/RunCMake/get_property/cache_properties-stderr.txt b/Tests/RunCMake/get_property/cache_properties-stderr.txt new file mode 100644 index 0000000..b1a2987 --- /dev/null +++ b/Tests/RunCMake/get_property/cache_properties-stderr.txt @@ -0,0 +1,3 @@ +^get_property: --><-- +get_property: -->value<-- +get_property: --><--$ diff --git a/Tests/RunCMake/get_property/cache_properties.cmake b/Tests/RunCMake/get_property/cache_properties.cmake new file mode 100644 index 0000000..e41adfd --- /dev/null +++ b/Tests/RunCMake/get_property/cache_properties.cmake @@ -0,0 +1,14 @@ +function (check_cache_property var prop) + get_property(gp_val + CACHE "${var}" + PROPERTY "${prop}") + + message("get_property: -->${gp_val}<--") +endfunction () + +set(var val CACHE STRING "doc") +set_property(CACHE var PROPERTY empty "" custom value) + +check_cache_property(var empty) +check_cache_property(var custom) +check_cache_property(var noexist) diff --git a/Tests/RunCMake/get_property/directory_properties-stderr.txt b/Tests/RunCMake/get_property/directory_properties-stderr.txt new file mode 100644 index 0000000..80c9877 --- /dev/null +++ b/Tests/RunCMake/get_property/directory_properties-stderr.txt @@ -0,0 +1,6 @@ +^get_directory_property: --><-- +get_property: --><-- +get_directory_property: -->value<-- +get_property: -->value<-- +get_directory_property: --><-- +get_property: --><--$ diff --git a/Tests/RunCMake/get_property/directory_properties.cmake b/Tests/RunCMake/get_property/directory_properties.cmake new file mode 100644 index 0000000..b0a9b1b --- /dev/null +++ b/Tests/RunCMake/get_property/directory_properties.cmake @@ -0,0 +1,15 @@ +function (check_directory_property dir prop) + get_directory_property(gdp_val DIRECTORY "${dir}" "${prop}") + get_property(gp_val + DIRECTORY "${dir}" + PROPERTY "${prop}") + + message("get_directory_property: -->${gdp_val}<--") + message("get_property: -->${gp_val}<--") +endfunction () + +set_directory_properties(PROPERTIES empty "" custom value) + +check_directory_property("${CMAKE_CURRENT_SOURCE_DIR}" empty) +check_directory_property("${CMAKE_CURRENT_SOURCE_DIR}" custom) +check_directory_property("${CMAKE_CURRENT_SOURCE_DIR}" noexist) diff --git a/Tests/RunCMake/get_property/global_properties-stderr.txt b/Tests/RunCMake/get_property/global_properties-stderr.txt new file mode 100644 index 0000000..b1a2987 --- /dev/null +++ b/Tests/RunCMake/get_property/global_properties-stderr.txt @@ -0,0 +1,3 @@ +^get_property: --><-- +get_property: -->value<-- +get_property: --><--$ diff --git a/Tests/RunCMake/get_property/global_properties.cmake b/Tests/RunCMake/get_property/global_properties.cmake new file mode 100644 index 0000000..5656a45 --- /dev/null +++ b/Tests/RunCMake/get_property/global_properties.cmake @@ -0,0 +1,14 @@ +function (check_global_property prop) + get_property(gp_val + GLOBAL + PROPERTY "${prop}") + + message("get_property: -->${gp_val}<--") +endfunction () + +set_property(GLOBAL PROPERTY empty "") +set_property(GLOBAL PROPERTY custom value) + +check_global_property(empty) +check_global_property(custom) +check_global_property(noexist) diff --git a/Tests/RunCMake/get_property/install_properties-stderr.txt b/Tests/RunCMake/get_property/install_properties-stderr.txt new file mode 100644 index 0000000..b1a2987 --- /dev/null +++ b/Tests/RunCMake/get_property/install_properties-stderr.txt @@ -0,0 +1,3 @@ +^get_property: --><-- +get_property: -->value<-- +get_property: --><--$ diff --git a/Tests/RunCMake/get_property/install_properties.cmake b/Tests/RunCMake/get_property/install_properties.cmake new file mode 100644 index 0000000..aa89225 --- /dev/null +++ b/Tests/RunCMake/get_property/install_properties.cmake @@ -0,0 +1,18 @@ +function (check_install_property file prop) + get_property(gp_val + INSTALL "${file}" + PROPERTY "${prop}") + + message("get_property: -->${gp_val}<--") +endfunction () + +install( + FILES "${CMAKE_CURRENT_LIST_FILE}" + DESTINATION "${CMAKE_CURRENT_LIST_DIR}" + RENAME "installed-file-dest") +set_property(INSTALL "${CMAKE_CURRENT_LIST_FILE}" PROPERTY empty "") +set_property(INSTALL "${CMAKE_CURRENT_LIST_FILE}" PROPERTY custom value) + +check_install_property("${CMAKE_CURRENT_LIST_FILE}" empty) +check_install_property("${CMAKE_CURRENT_LIST_FILE}" custom) +check_install_property("${CMAKE_CURRENT_LIST_FILE}" noexist) diff --git a/Tests/RunCMake/get_property/source_properties-stderr.txt b/Tests/RunCMake/get_property/source_properties-stderr.txt new file mode 100644 index 0000000..0a46f96 --- /dev/null +++ b/Tests/RunCMake/get_property/source_properties-stderr.txt @@ -0,0 +1,6 @@ +^get_source_file_property: --><-- +get_property: --><-- +get_source_file_property: -->value<-- +get_property: -->value<-- +get_source_file_property: -->NOTFOUND<-- +get_property: --><--$ diff --git a/Tests/RunCMake/get_property/source_properties.cmake b/Tests/RunCMake/get_property/source_properties.cmake new file mode 100644 index 0000000..263ffe1 --- /dev/null +++ b/Tests/RunCMake/get_property/source_properties.cmake @@ -0,0 +1,15 @@ +function (check_source_file_property file prop) + get_source_file_property(gsfp_val "${file}" "${prop}") + get_property(gp_val + SOURCE "${file}" + PROPERTY "${prop}") + + message("get_source_file_property: -->${gsfp_val}<--") + message("get_property: -->${gp_val}<--") +endfunction () + +set_source_files_properties(file.c PROPERTIES empty "" custom value) + +check_source_file_property(file.c empty) +check_source_file_property(file.c custom) +check_source_file_property(file.c noexist) diff --git a/Tests/RunCMake/get_property/target_properties-stderr.txt b/Tests/RunCMake/get_property/target_properties-stderr.txt new file mode 100644 index 0000000..d0981ac --- /dev/null +++ b/Tests/RunCMake/get_property/target_properties-stderr.txt @@ -0,0 +1,6 @@ +^get_target_property: --><-- +get_property: --><-- +get_target_property: -->value<-- +get_property: -->value<-- +get_target_property: -->gtp_val-NOTFOUND<-- +get_property: --><--$ diff --git a/Tests/RunCMake/get_property/target_properties.cmake b/Tests/RunCMake/get_property/target_properties.cmake new file mode 100644 index 0000000..c5a141d --- /dev/null +++ b/Tests/RunCMake/get_property/target_properties.cmake @@ -0,0 +1,16 @@ +function (check_target_property target prop) + get_target_property(gtp_val "${target}" "${prop}") + get_property(gp_val + TARGET "${target}" + PROPERTY "${prop}") + + message("get_target_property: -->${gtp_val}<--") + message("get_property: -->${gp_val}<--") +endfunction () + +add_custom_target(tgt) +set_target_properties(tgt PROPERTIES empty "" custom value) + +check_target_property(tgt empty) +check_target_property(tgt custom) +check_target_property(tgt noexist) diff --git a/Tests/RunCMake/get_property/test_properties-stderr.txt b/Tests/RunCMake/get_property/test_properties-stderr.txt new file mode 100644 index 0000000..a447280 --- /dev/null +++ b/Tests/RunCMake/get_property/test_properties-stderr.txt @@ -0,0 +1,6 @@ +^get_test_property: --><-- +get_property: --><-- +get_test_property: -->value<-- +get_property: -->value<-- +get_test_property: -->NOTFOUND<-- +get_property: --><--$ diff --git a/Tests/RunCMake/get_property/test_properties.cmake b/Tests/RunCMake/get_property/test_properties.cmake new file mode 100644 index 0000000..1d0295c --- /dev/null +++ b/Tests/RunCMake/get_property/test_properties.cmake @@ -0,0 +1,17 @@ +function (check_test_property test prop) + get_test_property("${test}" "${prop}" gtp_val) + get_property(gp_val + TEST "${test}" + PROPERTY "${prop}") + + message("get_test_property: -->${gtp_val}<--") + message("get_property: -->${gp_val}<--") +endfunction () + +include(CTest) +add_test(NAME test COMMAND "${CMAKE_COMMAND}" --help) +set_tests_properties(test PROPERTIES empty "" custom value) + +check_test_property(test empty) +check_test_property(test custom) +check_test_property(test noexist) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=95b3b096474932430f04433fc61a422239333b02 commit 95b3b096474932430f04433fc61a422239333b02 Author: Ben Boeckel <ben.boec...@kitware.com> AuthorDate: Thu Jan 8 16:19:26 2015 -0500 Commit: Ben Boeckel <ben.boec...@kitware.com> CommitDate: Thu Jan 8 16:33:31 2015 -0500 set_tests_properties: fix documentation The error is raised if the *test* doesn't exist, not the property. diff --git a/Help/command/set_tests_properties.rst b/Help/command/set_tests_properties.rst index e29d690..afac847 100644 --- a/Help/command/set_tests_properties.rst +++ b/Help/command/set_tests_properties.rst @@ -7,7 +7,7 @@ Set a property of the tests. set_tests_properties(test1 [test2...] PROPERTIES prop1 value1 prop2 value2) -Set a property for the tests. If the property is not found, CMake +Set a property for the tests. If the test is not found, CMake will report an error. Generator expressions will be expanded the same as supported by the test's add_test call. The properties include: http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bfc4b17aeb9fa6d2843f655052ac2c1a563bc25f commit bfc4b17aeb9fa6d2843f655052ac2c1a563bc25f Author: Ben Boeckel <ben.boec...@kitware.com> AuthorDate: Thu Jan 8 16:18:46 2015 -0500 Commit: Ben Boeckel <ben.boec...@kitware.com> CommitDate: Thu Jan 8 16:33:31 2015 -0500 get_test_property: clarify the documentation If either the test or the property doesn't exist, NOTFOUND will be used. No error is raised in either case. diff --git a/Help/command/get_test_property.rst b/Help/command/get_test_property.rst index 2623755..391a32e 100644 --- a/Help/command/get_test_property.rst +++ b/Help/command/get_test_property.rst @@ -7,9 +7,9 @@ Get a property of the test. get_test_property(test property VAR) -Get a property from the Test. The value of the property is stored in -the variable VAR. If the property is not found, VAR will be set to -"NOTFOUND". For a list of standard properties you can type cmake ---help-property-list +Get a property from the test. The value of the property is stored in +the variable VAR. If the test or property is not found, VAR will be +set to "NOTFOUND". For a list of standard properties you can type cmake +--help-property-list. See also the more general get_property() command. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5008f9da62218ba204dc0f1161d8ef39307fe061 commit 5008f9da62218ba204dc0f1161d8ef39307fe061 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Thu Jan 8 15:20:38 2015 -0500 Commit: Ben Boeckel <ben.boec...@kitware.com> CommitDate: Thu Jan 8 15:20:38 2015 -0500 cmGetTargetPropertyCommand: discern empty from undefined properties diff --git a/Source/cmGetTargetPropertyCommand.cxx b/Source/cmGetTargetPropertyCommand.cxx index aa6f0c1..fb59df8 100644 --- a/Source/cmGetTargetPropertyCommand.cxx +++ b/Source/cmGetTargetPropertyCommand.cxx @@ -23,6 +23,7 @@ bool cmGetTargetPropertyCommand std::string var = args[0]; const std::string& targetName = args[1]; std::string prop; + bool prop_exists = false; if(args[2] == "ALIASED_TARGET") { @@ -32,6 +33,7 @@ bool cmGetTargetPropertyCommand this->Makefile->FindTargetToUse(targetName)) { prop = target->GetName(); + prop_exists = true; } } } @@ -42,6 +44,7 @@ bool cmGetTargetPropertyCommand if(prop_cstr) { prop = prop_cstr; + prop_exists = true; } } else @@ -74,7 +77,7 @@ bool cmGetTargetPropertyCommand } } } - if (!prop.empty()) + if (prop_exists) { this->Makefile->AddDefinition(var, prop.c_str()); return true; ----------------------------------------------------------------------- Summary of changes: Help/command/get_test_property.rst | 8 ++++---- Help/command/set_tests_properties.rst | 2 +- Source/cmGetTargetPropertyCommand.cxx | 5 ++++- Tests/RunCMake/CMakeLists.txt | 1 + .../{CMP0004 => get_property}/CMakeLists.txt | 0 Tests/RunCMake/get_property/RunCMakeTest.cmake | 9 +++++++++ .../get_property/cache_properties-stderr.txt | 3 +++ Tests/RunCMake/get_property/cache_properties.cmake | 14 ++++++++++++++ .../get_property/directory_properties-stderr.txt | 6 ++++++ .../RunCMake/get_property/directory_properties.cmake | 15 +++++++++++++++ .../get_property/global_properties-stderr.txt | 3 +++ Tests/RunCMake/get_property/global_properties.cmake | 14 ++++++++++++++ .../get_property/install_properties-stderr.txt | 3 +++ Tests/RunCMake/get_property/install_properties.cmake | 18 ++++++++++++++++++ .../get_property/source_properties-stderr.txt | 6 ++++++ Tests/RunCMake/get_property/source_properties.cmake | 15 +++++++++++++++ .../get_property/target_properties-stderr.txt | 6 ++++++ Tests/RunCMake/get_property/target_properties.cmake | 16 ++++++++++++++++ .../RunCMake/get_property/test_properties-stderr.txt | 6 ++++++ Tests/RunCMake/get_property/test_properties.cmake | 17 +++++++++++++++++ 20 files changed, 161 insertions(+), 6 deletions(-) copy Tests/RunCMake/{CMP0004 => get_property}/CMakeLists.txt (100%) create mode 100644 Tests/RunCMake/get_property/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/get_property/cache_properties-stderr.txt create mode 100644 Tests/RunCMake/get_property/cache_properties.cmake create mode 100644 Tests/RunCMake/get_property/directory_properties-stderr.txt create mode 100644 Tests/RunCMake/get_property/directory_properties.cmake create mode 100644 Tests/RunCMake/get_property/global_properties-stderr.txt create mode 100644 Tests/RunCMake/get_property/global_properties.cmake create mode 100644 Tests/RunCMake/get_property/install_properties-stderr.txt create mode 100644 Tests/RunCMake/get_property/install_properties.cmake create mode 100644 Tests/RunCMake/get_property/source_properties-stderr.txt create mode 100644 Tests/RunCMake/get_property/source_properties.cmake create mode 100644 Tests/RunCMake/get_property/target_properties-stderr.txt create mode 100644 Tests/RunCMake/get_property/target_properties.cmake create mode 100644 Tests/RunCMake/get_property/test_properties-stderr.txt create mode 100644 Tests/RunCMake/get_property/test_properties.cmake hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/mailman/listinfo/cmake-commits