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 e5cde94df65918cf4d51ef7b8747732a02a3bdaf (commit) via 911120284f9d3bd8e9d98e20e5bd0f292a2c958a (commit) via d770c2f5291fc87c155628e349c39cf2bbee5d00 (commit) from bf034eac301d0242c5fe673bb062bbea95ac73f5 (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=e5cde94df65918cf4d51ef7b8747732a02a3bdaf commit e5cde94df65918cf4d51ef7b8747732a02a3bdaf Merge: bf034ea 9111202 Author: Ben Boeckel <ben.boec...@kitware.com> AuthorDate: Fri Oct 24 10:52:54 2014 -0400 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Fri Oct 24 10:52:54 2014 -0400 Merge topic 'variable-pull-failure' into next 91112028 cmDefinitions: only pull variables if they aren't local d770c2f5 test: add test for PARENT_SCOPE behavior http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=911120284f9d3bd8e9d98e20e5bd0f292a2c958a commit 911120284f9d3bd8e9d98e20e5bd0f292a2c958a Author: Ben Boeckel <ben.boec...@kitware.com> AuthorDate: Fri Oct 24 10:48:21 2014 -0400 Commit: Ben Boeckel <ben.boec...@kitware.com> CommitDate: Fri Oct 24 10:51:59 2014 -0400 cmDefinitions: only pull variables if they aren't local Prior to the commit which changed behavior here, PARENT_SCOPE triggered a ->GetInternal() call which would internally pull down the parent's value into the local scope. When converted over to an explicit ->Pull() call, the logic in ->GetInternal() which ignored the parent if it is already in scope was missed and instead unconditionally pulled down. Reported-By: Ben Cooksley <bcooks...@kde.org> diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx index 5515f35..8a0e95e 100644 --- a/Source/cmDefinitions.cxx +++ b/Source/cmDefinitions.cxx @@ -71,7 +71,7 @@ const char* cmDefinitions::Get(const std::string& key) const //---------------------------------------------------------------------------- void cmDefinitions::Pull(const std::string& key) { - if (this->Up) + if (this->Up && this->Map.find(key) == this->Map.end()) { Def const& def = this->Up->GetInternal(key); if (def.Exists) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d770c2f5291fc87c155628e349c39cf2bbee5d00 commit d770c2f5291fc87c155628e349c39cf2bbee5d00 Author: Ben Boeckel <ben.boec...@kitware.com> AuthorDate: Fri Oct 24 10:47:36 2014 -0400 Commit: Ben Boeckel <ben.boec...@kitware.com> CommitDate: Fri Oct 24 10:51:08 2014 -0400 test: add test for PARENT_SCOPE behavior Test code courtesy of Alex Merry <alex.me...@kde.org>. diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index fd3bb03..6e35327 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -118,6 +118,7 @@ add_RunCMake_test(alias_targets) add_RunCMake_test(interface_library) add_RunCMake_test(no_install_prefix) add_RunCMake_test(configure_file) +add_RunCMake_test(ParentScope) find_package(Qt4 QUIET) find_package(Qt5Core QUIET) diff --git a/Tests/RunCMake/ParentScope/CMakeLists.txt b/Tests/RunCMake/ParentScope/CMakeLists.txt new file mode 100644 index 0000000..12cd3c7 --- /dev/null +++ b/Tests/RunCMake/ParentScope/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/ParentScope/ParentPulling-stderr.txt b/Tests/RunCMake/ParentScope/ParentPulling-stderr.txt new file mode 100644 index 0000000..768549b --- /dev/null +++ b/Tests/RunCMake/ParentScope/ParentPulling-stderr.txt @@ -0,0 +1,3 @@ +^before PARENT_SCOPE blah=value2 +after PARENT_SCOPE blah=value2 +in parent scope, blah=value2$ diff --git a/Tests/RunCMake/ParentScope/ParentPulling.cmake b/Tests/RunCMake/ParentScope/ParentPulling.cmake new file mode 100644 index 0000000..2614533 --- /dev/null +++ b/Tests/RunCMake/ParentScope/ParentPulling.cmake @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.0) +project(Minimal NONE) + +function(test_set) + set(blah "value2") + message("before PARENT_SCOPE blah=${blah}") + set(blah ${blah} PARENT_SCOPE) + message("after PARENT_SCOPE blah=${blah}") +endfunction() + +set(blah value1) +test_set() +message("in parent scope, blah=${blah}") diff --git a/Tests/RunCMake/ParentScope/RunCMakeTest.cmake b/Tests/RunCMake/ParentScope/RunCMakeTest.cmake new file mode 100644 index 0000000..ca517b2 --- /dev/null +++ b/Tests/RunCMake/ParentScope/RunCMakeTest.cmake @@ -0,0 +1,3 @@ +include(RunCMake) + +run_cmake(ParentPulling) ----------------------------------------------------------------------- Summary of changes: Source/cmDefinitions.cxx | 2 +- Tests/RunCMake/CMakeLists.txt | 1 + Tests/RunCMake/{CMP0004 => ParentScope}/CMakeLists.txt | 0 Tests/RunCMake/ParentScope/ParentPulling-stderr.txt | 3 +++ Tests/RunCMake/ParentScope/ParentPulling.cmake | 13 +++++++++++++ Tests/RunCMake/ParentScope/RunCMakeTest.cmake | 3 +++ 6 files changed, 21 insertions(+), 1 deletion(-) copy Tests/RunCMake/{CMP0004 => ParentScope}/CMakeLists.txt (100%) create mode 100644 Tests/RunCMake/ParentScope/ParentPulling-stderr.txt create mode 100644 Tests/RunCMake/ParentScope/ParentPulling.cmake create mode 100644 Tests/RunCMake/ParentScope/RunCMakeTest.cmake hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/mailman/listinfo/cmake-commits