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 1ccd75a38da70aaa0da56e284d99fa74673fd8ec (commit) via 93191bdd52f895fb31d2954608f3f606ed4c0462 (commit) via e3f65f7244fc76baf3adc203b566d538cb56bc43 (commit) via fd58d54853254cac1418b3b53d9f3cfa80ab5b26 (commit) via 865a45eb93dc8e36e0eb5858647f7f6b09c82107 (commit) via e3c07411ea7690321f8df75ba8580b17d4146fd0 (commit) from 1111128aed75a31e288b48cb0d314cc24768ad98 (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=1ccd75a38da70aaa0da56e284d99fa74673fd8ec commit 1ccd75a38da70aaa0da56e284d99fa74673fd8ec Merge: 1111128 93191bd Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Wed Jan 8 10:16:51 2014 -0500 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Wed Jan 8 10:16:51 2014 -0500 Merge topic 'policies' into next 93191bd Add backtrace to output. e3f65f7 Add missing colons. fd58d54 get_target_property: Error on non-existent target. 865a45e FindQt4: Ensure target exists before calling get_target_property. e3c0741 FindQt4: Fix use of get_target_property to use actual target name. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=93191bdd52f895fb31d2954608f3f606ed4c0462 commit 93191bdd52f895fb31d2954608f3f606ed4c0462 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Wed Jan 8 16:16:02 2014 +0100 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Wed Jan 8 16:16:02 2014 +0100 Add backtrace to output. diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 9918d85..1feb03a 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -426,8 +426,9 @@ struct CompilerIdNode : public cmGeneratorExpressionNode cmOStringStream e; e << context->Makefile->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0044); - context->Makefile->IssueMessage(cmake::AUTHOR_WARNING, - e.str().c_str()); + context->Makefile->GetCMakeInstance() + ->IssueMessage(cmake::AUTHOR_WARNING, + e.str().c_str(), context->Backtrace); } case cmPolicies::OLD: return "1"; diff --git a/Tests/RunCMake/GeneratorExpression/CMP0044-WARN-stderr.txt b/Tests/RunCMake/GeneratorExpression/CMP0044-WARN-stderr.txt index 3b2d9bb..2079c12 100644 --- a/Tests/RunCMake/GeneratorExpression/CMP0044-WARN-stderr.txt +++ b/Tests/RunCMake/GeneratorExpression/CMP0044-WARN-stderr.txt @@ -1,5 +1,7 @@ -CMake Warning \(dev\) in CMakeLists.txt: +CMake Warning \(dev\) at CMP0044-WARN.cmake:13 \(target_compile_definitions\): Policy CMP0044 is not set: Case sensitive <LANG>_COMPILER_ID generator expressions. Run "cmake --help-policy CMP0044" for policy details. Use the cmake_policy command to set the policy and suppress this warning. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) This warning is for project developers. Use -Wno-dev to suppress it. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e3f65f7244fc76baf3adc203b566d538cb56bc43 commit e3f65f7244fc76baf3adc203b566d538cb56bc43 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Wed Jan 8 16:10:14 2014 +0100 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Wed Jan 8 16:10:14 2014 +0100 Add missing colons. diff --git a/Help/policy/CMP0043.rst b/Help/policy/CMP0043.rst index ce43fab..89a6cde 100644 --- a/Help/policy/CMP0043.rst +++ b/Help/policy/CMP0043.rst @@ -25,9 +25,9 @@ or via :command:`target_compile_definitions`: # New Interfaces: set_property(TARGET tgt APPEND PROPERTY - COMPILE_DEFINITIONS $<$<CONFIG:Debug>DEBUG_MODE> + COMPILE_DEFINITIONS $<$<CONFIG:Debug>:DEBUG_MODE> ) - target_compile_definitions(tgt PRIVATE $<$<CONFIG:Debug>DEBUG_MODE>) + target_compile_definitions(tgt PRIVATE $<$<CONFIG:Debug>:DEBUG_MODE>) The OLD behavior for this policy is to consume the content of the suffixed :prop_tgt:`COMPILE_DEFINITIONS_<CONFIG>` target property when generating the http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fd58d54853254cac1418b3b53d9f3cfa80ab5b26 commit fd58d54853254cac1418b3b53d9f3cfa80ab5b26 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Wed Jan 8 13:16:33 2014 +0100 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Wed Jan 8 15:42:53 2014 +0100 get_target_property: Error on non-existent target. Introduce policy CMP0045 to control this behavior. diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index e9c31a7..c9f39c4 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -94,3 +94,4 @@ All Policies /policy/CMP0042 /policy/CMP0043 /policy/CMP0044 + /policy/CMP0045 diff --git a/Help/policy/CMP0045.rst b/Help/policy/CMP0045.rst new file mode 100644 index 0000000..748eb6a --- /dev/null +++ b/Help/policy/CMP0045.rst @@ -0,0 +1,17 @@ +CMP0045 +------- + +Error on non-existent target in get_target_property. + +In CMake 2.8.12 and lower, the :command:`get_target_property` command accepted +a non-existent target argument without issuing any error or warning. The +result variable is set to a ``-NOTFOUND`` value. + +The OLD behavior for this policy is to issue no warning and set the result +variable to a ``-NOTFOUND`` value. The NEW behavior +for this policy is to issue a ``FATAL_ERROR`` if the command is called with a +non-existent target. + +This policy was introduced in CMake version 3.0.0. CMake version +|release| warns when the policy is not set and uses OLD behavior. Use +the cmake_policy command to set it to OLD or NEW explicitly. diff --git a/Source/cmGetTargetPropertyCommand.cxx b/Source/cmGetTargetPropertyCommand.cxx index 02f00a5..488cc28 100644 --- a/Source/cmGetTargetPropertyCommand.cxx +++ b/Source/cmGetTargetPropertyCommand.cxx @@ -40,7 +40,36 @@ bool cmGetTargetPropertyCommand cmTarget& target = *tgt; prop = target.GetProperty(args[2].c_str()); } - + else + { + bool issueMessage = false; + cmOStringStream e; + cmake::MessageType messageType = cmake::AUTHOR_WARNING; + switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0045)) + { + case cmPolicies::WARN: + issueMessage = true; + e << this->Makefile->GetPolicies() + ->GetPolicyWarning(cmPolicies::CMP0045) << "\n"; + case cmPolicies::OLD: + break; + case cmPolicies::REQUIRED_IF_USED: + case cmPolicies::REQUIRED_ALWAYS: + case cmPolicies::NEW: + issueMessage = true; + messageType = cmake::FATAL_ERROR; + } + if (issueMessage) + { + e << "get_target_property() called with non-existent target \"" + << targetName << "\"."; + this->Makefile->IssueMessage(messageType, e.str().c_str()); + if (messageType == cmake::FATAL_ERROR) + { + return false; + } + } + } if (prop) { this->Makefile->AddDefinition(var.c_str(), prop); diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index c9dacaf..5a189f8 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -326,6 +326,11 @@ cmPolicies::cmPolicies() CMP0044, "CMP0044", "Case sensitive <LANG>_COMPILER_ID generator expressions.", 3,0,0,0, cmPolicies::WARN); + + this->DefinePolicy( + CMP0045, "CMP0045", + "Error on non-existent target in get_target_property.", + 3,0,0,0, cmPolicies::WARN); } cmPolicies::~cmPolicies() diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index 0d7327f..b1342bf 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -98,6 +98,7 @@ public: CMP0042, ///< Enable MACOSX_RPATH by default CMP0043, ///< Ignore COMPILE_DEFINITIONS_<Config> properties CMP0044, ///< Case sensitive <LANG>_COMPILER_ID generator expressions + CMP0045, ///< Error on non-existent target in get_target_property /** \brief Always the last entry. * diff --git a/Tests/RunCMake/CMP0045/CMP0045-NEW-result.txt b/Tests/RunCMake/CMP0045/CMP0045-NEW-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMP0045/CMP0045-NEW-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMP0045/CMP0045-NEW-stderr.txt b/Tests/RunCMake/CMP0045/CMP0045-NEW-stderr.txt new file mode 100644 index 0000000..805a85e --- /dev/null +++ b/Tests/RunCMake/CMP0045/CMP0045-NEW-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at CMP0045-NEW.cmake:4 \(get_target_property\): + get_target_property\(\) called with non-existent target "tgt". +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CMP0045/CMP0045-NEW.cmake b/Tests/RunCMake/CMP0045/CMP0045-NEW.cmake new file mode 100644 index 0000000..7b2a3cd --- /dev/null +++ b/Tests/RunCMake/CMP0045/CMP0045-NEW.cmake @@ -0,0 +1,4 @@ + +cmake_policy(SET CMP0045 NEW) + +get_target_property(result tgt TYPE) diff --git a/Tests/RunCMake/CMP0045/CMP0045-OLD-result.txt b/Tests/RunCMake/CMP0045/CMP0045-OLD-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0045/CMP0045-OLD-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0045/CMP0045-OLD-stderr.txt b/Tests/RunCMake/CMP0045/CMP0045-OLD-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/CMP0045/CMP0045-OLD-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/CMP0045/CMP0045-OLD.cmake b/Tests/RunCMake/CMP0045/CMP0045-OLD.cmake new file mode 100644 index 0000000..90201a3 --- /dev/null +++ b/Tests/RunCMake/CMP0045/CMP0045-OLD.cmake @@ -0,0 +1,4 @@ + +cmake_policy(SET CMP0045 OLD) + +get_target_property(result tgt TYPE) diff --git a/Tests/RunCMake/CMP0045/CMP0045-WARN-result.txt b/Tests/RunCMake/CMP0045/CMP0045-WARN-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0045/CMP0045-WARN-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0045/CMP0045-WARN-stderr.txt b/Tests/RunCMake/CMP0045/CMP0045-WARN-stderr.txt new file mode 100644 index 0000000..4c53224 --- /dev/null +++ b/Tests/RunCMake/CMP0045/CMP0045-WARN-stderr.txt @@ -0,0 +1,9 @@ +CMake Warning \(dev\) at CMP0045-WARN.cmake:2 \(get_target_property\): + Policy CMP0045 is not set: Error on non-existent target in + get_target_property. Run "cmake --help-policy CMP0045" for policy details. + Use the cmake_policy command to set the policy and suppress this warning. + + get_target_property\(\) called with non-existent target "tgt". +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0045/CMP0045-WARN.cmake b/Tests/RunCMake/CMP0045/CMP0045-WARN.cmake new file mode 100644 index 0000000..86a99a0 --- /dev/null +++ b/Tests/RunCMake/CMP0045/CMP0045-WARN.cmake @@ -0,0 +1,2 @@ + +get_target_property(result tgt TYPE) diff --git a/Tests/RunCMake/CMP0045/CMakeLists.txt b/Tests/RunCMake/CMP0045/CMakeLists.txt new file mode 100644 index 0000000..11ea636 --- /dev/null +++ b/Tests/RunCMake/CMP0045/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8) +project(${RunCMake_TEST} CXX) +include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE) diff --git a/Tests/RunCMake/CMP0045/RunCMakeTest.cmake b/Tests/RunCMake/CMP0045/RunCMakeTest.cmake new file mode 100644 index 0000000..7c0e8a2 --- /dev/null +++ b/Tests/RunCMake/CMP0045/RunCMakeTest.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +run_cmake(CMP0045-OLD) +run_cmake(CMP0045-NEW) +run_cmake(CMP0045-WARN) diff --git a/Tests/RunCMake/CMP0045/empty.cpp b/Tests/RunCMake/CMP0045/empty.cpp new file mode 100644 index 0000000..bfbbdde --- /dev/null +++ b/Tests/RunCMake/CMP0045/empty.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 01ab5d4..944b898 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -65,6 +65,7 @@ if(CMAKE_SYSTEM_NAME MATCHES Darwin AND CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG) add_RunCMake_test(CMP0042) endif() add_RunCMake_test(CMP0043) +add_RunCMake_test(CMP0045) add_RunCMake_test(CTest) if(UNIX AND "${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles") add_RunCMake_test(CompilerChange) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=865a45eb93dc8e36e0eb5858647f7f6b09c82107 commit 865a45eb93dc8e36e0eb5858647f7f6b09c82107 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Wed Jan 8 10:26:49 2014 +0100 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Wed Jan 8 13:32:29 2014 +0100 FindQt4: Ensure target exists before calling get_target_property. This macro is called for all potential Qt targets, even those which were not found. diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 2c4e765..03924fa 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -1178,20 +1178,24 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) endmacro() macro(_qt4_add_target_depends _QT_MODULE) - get_target_property(_configs Qt4::${_QT_MODULE} IMPORTED_CONFIGURATIONS) - _qt4_add_target_depends_internal(${_QT_MODULE} INTERFACE_LINK_LIBRARIES ${ARGN}) - foreach(_config ${_configs}) - _qt4_add_target_depends_internal(${_QT_MODULE} IMPORTED_LINK_INTERFACE_LIBRARIES_${_config} ${ARGN}) - endforeach() - set(_configs) + if (TARGET Qt4::${_QT_MODULE}) + get_target_property(_configs Qt4::${_QT_MODULE} IMPORTED_CONFIGURATIONS) + _qt4_add_target_depends_internal(${_QT_MODULE} INTERFACE_LINK_LIBRARIES ${ARGN}) + foreach(_config ${_configs}) + _qt4_add_target_depends_internal(${_QT_MODULE} IMPORTED_LINK_INTERFACE_LIBRARIES_${_config} ${ARGN}) + endforeach() + set(_configs) + endif() endmacro() macro(_qt4_add_target_private_depends _QT_MODULE) - get_target_property(_configs Qt4::${_QT_MODULE} IMPORTED_CONFIGURATIONS) - foreach(_config ${_configs}) - _qt4_add_target_depends_internal(${_QT_MODULE} IMPORTED_LINK_DEPENDENT_LIBRARIES_${_config} ${ARGN}) - endforeach() - set(_configs) + if (TARGET Qt4::${_QT_MODULE}) + get_target_property(_configs Qt4::${_QT_MODULE} IMPORTED_CONFIGURATIONS) + foreach(_config ${_configs}) + _qt4_add_target_depends_internal(${_QT_MODULE} IMPORTED_LINK_DEPENDENT_LIBRARIES_${_config} ${ARGN}) + endforeach() + set(_configs) + endif() endmacro() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e3c07411ea7690321f8df75ba8580b17d4146fd0 commit e3c07411ea7690321f8df75ba8580b17d4146fd0 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Wed Jan 8 10:25:07 2014 +0100 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Wed Jan 8 13:32:29 2014 +0100 FindQt4: Fix use of get_target_property to use actual target name. This was introduced in ba48e63f (Generate config-specific interface link libraries propeties., 2013-02-09). diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 28b8454..2c4e765 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -1187,7 +1187,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION) endmacro() macro(_qt4_add_target_private_depends _QT_MODULE) - get_target_property(_configs ${_QT_MODULE} IMPORTED_CONFIGURATIONS) + get_target_property(_configs Qt4::${_QT_MODULE} IMPORTED_CONFIGURATIONS) foreach(_config ${_configs}) _qt4_add_target_depends_internal(${_QT_MODULE} IMPORTED_LINK_DEPENDENT_LIBRARIES_${_config} ${ARGN}) endforeach() ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-policies.7.rst | 1 + Help/policy/CMP0043.rst | 4 +- Help/policy/CMP0045.rst | 17 +++++++++++ Modules/FindQt4.cmake | 26 +++++++++------- Source/cmGeneratorExpressionEvaluator.cxx | 5 ++- Source/cmGetTargetPropertyCommand.cxx | 31 +++++++++++++++++++- Source/cmPolicies.cxx | 5 +++ Source/cmPolicies.h | 1 + .../CMP0045-NEW-result.txt} | 0 Tests/RunCMake/CMP0045/CMP0045-NEW-stderr.txt | 4 ++ Tests/RunCMake/CMP0045/CMP0045-NEW.cmake | 4 ++ .../CMP0045-OLD-result.txt} | 0 .../CMP0045-OLD-stderr.txt} | 0 Tests/RunCMake/CMP0045/CMP0045-OLD.cmake | 4 ++ .../CMP0045-WARN-result.txt} | 0 Tests/RunCMake/CMP0045/CMP0045-WARN-stderr.txt | 9 ++++++ Tests/RunCMake/CMP0045/CMP0045-WARN.cmake | 2 + Tests/RunCMake/{CMP0041 => CMP0045}/CMakeLists.txt | 0 Tests/RunCMake/CMP0045/RunCMakeTest.cmake | 5 +++ Tests/RunCMake/{CMP0022 => CMP0045}/empty.cpp | 0 Tests/RunCMake/CMakeLists.txt | 1 + .../GeneratorExpression/CMP0044-WARN-stderr.txt | 4 ++- 22 files changed, 106 insertions(+), 17 deletions(-) create mode 100644 Help/policy/CMP0045.rst copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CMP0045/CMP0045-NEW-result.txt} (100%) create mode 100644 Tests/RunCMake/CMP0045/CMP0045-NEW-stderr.txt create mode 100644 Tests/RunCMake/CMP0045/CMP0045-NEW.cmake copy Tests/RunCMake/{CMP0022/CMP0022-WARN-empty-old-result.txt => CMP0045/CMP0045-OLD-result.txt} (100%) copy Tests/RunCMake/{CMP0022/CMP0022-NOWARN-exe-stderr.txt => CMP0045/CMP0045-OLD-stderr.txt} (100%) create mode 100644 Tests/RunCMake/CMP0045/CMP0045-OLD.cmake copy Tests/RunCMake/{CMP0022/CMP0022-WARN-empty-old-result.txt => CMP0045/CMP0045-WARN-result.txt} (100%) create mode 100644 Tests/RunCMake/CMP0045/CMP0045-WARN-stderr.txt create mode 100644 Tests/RunCMake/CMP0045/CMP0045-WARN.cmake copy Tests/RunCMake/{CMP0041 => CMP0045}/CMakeLists.txt (100%) create mode 100644 Tests/RunCMake/CMP0045/RunCMakeTest.cmake copy Tests/RunCMake/{CMP0022 => CMP0045}/empty.cpp (100%) hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits