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, master has been updated via ae2b12a95c346d710459657c3cce967bd590f678 (commit) via 6646771b0f4f6ec71a5717a68f74c987eb399b4e (commit) via 08eb157c032487b2793e625c554caae33267116d (commit) from 873f40ecec50fbe6c8e98a0764c02a423dbfa05b (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 ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ae2b12a95c346d710459657c3cce967bd590f678 commit ae2b12a95c346d710459657c3cce967bd590f678 Merge: 873f40e 6646771 Author: Craig Scott <craig.sc...@crascit.com> AuthorDate: Wed Jul 25 12:14:53 2018 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Wed Jul 25 08:15:02 2018 -0400 Merge topic 'project-injected-no-cmp0048' 6646771b0f project: Do not issue CMP0048 warnings on injected call 08eb157c03 Tests: Add case showing CMP0048 warning on injected project command Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !2235 diff --cc Tests/RunCMake/CMakeLists.txt index 97c3178,637c5c2..c030cda --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@@ -238,10 -238,9 +238,11 @@@ add_RunCMake_test(include add_RunCMake_test(include_directories) add_RunCMake_test(include_guard) add_RunCMake_test(list) +add_RunCMake_test(math) add_RunCMake_test(message) +add_RunCMake_test(option) add_RunCMake_test(project -DCMake_TEST_RESOURCES=${CMake_TEST_RESOURCES}) + add_RunCMake_test(project_injected) add_RunCMake_test(return) add_RunCMake_test(separate_arguments) add_RunCMake_test(set_property) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6646771b0f4f6ec71a5717a68f74c987eb399b4e commit 6646771b0f4f6ec71a5717a68f74c987eb399b4e Author: Brad King <brad.k...@kitware.com> AuthorDate: Tue Jul 24 13:10:14 2018 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Tue Jul 24 13:14:10 2018 -0400 project: Do not issue CMP0048 warnings on injected call Fixes: #18202 diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 3c7a4cf..af97f80 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1511,6 +1511,8 @@ void cmMakefile::Configure() project.Name.Lower = "project"; project.Arguments.emplace_back("Project", cmListFileArgument::Unquoted, 0); + project.Arguments.emplace_back("__CMAKE_INJECTED_PROJECT_COMMAND__", + cmListFileArgument::Unquoted, 0); listFile.Functions.insert(listFile.Functions.begin(), project); } } diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index a25bd6b..ee44007 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -69,6 +69,7 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args, bool haveLanguages = false; bool haveDescription = false; bool haveHomepage = false; + bool injectedProjectCommand = false; std::string version; std::string description; std::string homepage; @@ -160,6 +161,8 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args, "by a value that expanded to nothing."); resetReporter(); }; + } else if (i == 1 && args[i] == "__CMAKE_INJECTED_PROJECT_COMMAND__") { + injectedProjectCommand = true; } else if (doing == DoingVersion) { doing = DoingLanguages; version = args[i]; @@ -280,8 +283,10 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args, const char* v = this->Makefile->GetDefinition(i); if (v && *v) { if (cmp0048 == cmPolicies::WARN) { - vw += "\n "; - vw += i; + if (!injectedProjectCommand) { + vw += "\n "; + vw += i; + } } else { this->Makefile->AddDefinition(i, ""); } diff --git a/Tests/RunCMake/project_injected/CMP0048-WARN-stderr.txt b/Tests/RunCMake/project_injected/CMP0048-WARN-stderr.txt deleted file mode 100644 index aafa733..0000000 --- a/Tests/RunCMake/project_injected/CMP0048-WARN-stderr.txt +++ /dev/null @@ -1,12 +0,0 @@ -^CMake Warning \(dev\) in CMakeLists.txt: - Policy CMP0048 is not set: project\(\) command manages VERSION variables. - Run "cmake --help-policy CMP0048" for policy details. Use the cmake_policy - command to set the policy and suppress this warning. - - The following variable\(s\) would be set to empty: - - CMAKE_PROJECT_VERSION - CMAKE_PROJECT_VERSION_MAJOR - CMAKE_PROJECT_VERSION_MINOR - CMAKE_PROJECT_VERSION_PATCH -This warning is for project developers. Use -Wno-dev to suppress it.$ https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=08eb157c032487b2793e625c554caae33267116d commit 08eb157c032487b2793e625c554caae33267116d Author: Brad King <brad.k...@kitware.com> AuthorDate: Tue Jul 24 13:05:22 2018 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Tue Jul 24 13:14:09 2018 -0400 Tests: Add case showing CMP0048 warning on injected project command Issue: #18202 diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index bb46144..637c5c2 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -240,6 +240,7 @@ add_RunCMake_test(include_guard) add_RunCMake_test(list) add_RunCMake_test(message) add_RunCMake_test(project -DCMake_TEST_RESOURCES=${CMake_TEST_RESOURCES}) +add_RunCMake_test(project_injected) add_RunCMake_test(return) add_RunCMake_test(separate_arguments) add_RunCMake_test(set_property) diff --git a/Tests/RunCMake/project_injected/CMP0048-WARN-stderr.txt b/Tests/RunCMake/project_injected/CMP0048-WARN-stderr.txt new file mode 100644 index 0000000..aafa733 --- /dev/null +++ b/Tests/RunCMake/project_injected/CMP0048-WARN-stderr.txt @@ -0,0 +1,12 @@ +^CMake Warning \(dev\) in CMakeLists.txt: + Policy CMP0048 is not set: project\(\) command manages VERSION variables. + Run "cmake --help-policy CMP0048" for policy details. Use the cmake_policy + command to set the policy and suppress this warning. + + The following variable\(s\) would be set to empty: + + CMAKE_PROJECT_VERSION + CMAKE_PROJECT_VERSION_MAJOR + CMAKE_PROJECT_VERSION_MINOR + CMAKE_PROJECT_VERSION_PATCH +This warning is for project developers. Use -Wno-dev to suppress it.$ diff --git a/Tests/RunCMake/project_injected/CMP0048-WARN.cmake b/Tests/RunCMake/project_injected/CMP0048-WARN.cmake new file mode 100644 index 0000000..e69de29 diff --git a/Tests/RunCMake/project_injected/CMakeLists.txt b/Tests/RunCMake/project_injected/CMakeLists.txt new file mode 100644 index 0000000..1b4931b --- /dev/null +++ b/Tests/RunCMake/project_injected/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.12.2) # old enough to not set CMP0048 +# no project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/project_injected/RunCMakeTest.cmake b/Tests/RunCMake/project_injected/RunCMakeTest.cmake new file mode 100644 index 0000000..ba1a003 --- /dev/null +++ b/Tests/RunCMake/project_injected/RunCMakeTest.cmake @@ -0,0 +1,12 @@ +include(RunCMake) + +set(RunCMake_TEST_OPTIONS + # Simulate a previous CMake run that used `project(... VERSION ...)` + # in a non-injected call site. + -DCMAKE_PROJECT_VERSION:STATIC=1.2.3 + -DCMAKE_PROJECT_VERSION_MAJOR:STATIC=1 + -DCMAKE_PROJECT_VERSION_MINOR:STATIC=2 + -DCMAKE_PROJECT_VERSION_PATCH:STATIC=3 + ) +run_cmake(CMP0048-WARN) +unset(RunCMake_TEST_OPTIONS) ----------------------------------------------------------------------- Summary of changes: Source/cmMakefile.cxx | 2 ++ Source/cmProjectCommand.cxx | 9 +++++++-- Tests/RunCMake/CMakeLists.txt | 1 + .../project_injected/CMP0048-WARN.cmake} | 0 Tests/RunCMake/project_injected/CMakeLists.txt | 3 +++ Tests/RunCMake/project_injected/RunCMakeTest.cmake | 12 ++++++++++++ 6 files changed, 25 insertions(+), 2 deletions(-) copy Tests/{Wrapping/vtkIncluded.cxx => RunCMake/project_injected/CMP0048-WARN.cmake} (100%) create mode 100644 Tests/RunCMake/project_injected/CMakeLists.txt create mode 100644 Tests/RunCMake/project_injected/RunCMakeTest.cmake hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org https://cmake.org/mailman/listinfo/cmake-commits