diff --git a/Help/policy/CMP0048.rst b/Help/policy/CMP0048.rst index 61921361c2..76a74ce5b1 100644 --- a/Help/policy/CMP0048.rst +++ b/Help/policy/CMP0048.rst @@ -1,6 +1,9 @@ CMP0048 ------- +.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0 +.. include:: REMOVED_PROLOGUE.txt + The :command:`project` command manages ``VERSION`` variables. CMake version 3.0 introduced the ``VERSION`` option of the :command:`project` @@ -17,7 +20,5 @@ The ``NEW`` behavior for this policy is to set ``VERSION`` as documented by the :command:`project` command. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0 -.. |WARNS_OR_DOES_NOT_WARN| replace:: warns -.. include:: STANDARD_ADVICE.txt - -.. include:: DEPRECATED.txt +.. |WARNED_OR_DID_NOT_WARN| replace:: warned +.. include:: REMOVED_EPILOGUE.txt diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 386953aa8d..480884a20a 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1694,13 +1694,9 @@ void cmMakefile::Configure() "CMake is pretending there is a \"project(Project)\" command on " "the first line.", this->Backtrace); - cmListFileFunction project{ "project", - 0, - 0, - { { "Project", cmListFileArgument::Unquoted, - 0 }, - { "__CMAKE_INJECTED_PROJECT_COMMAND__", - cmListFileArgument::Unquoted, 0 } } }; + cmListFileFunction project{ + "project", 0, 0, { { "Project", cmListFileArgument::Unquoted, 0 } } + }; listFile.Functions.insert(listFile.Functions.begin(), project); } } diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index 88f3633f97..62c21f48c0 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -145,7 +145,7 @@ class cmMakefile; SELECT(POLICY, CMP0047, "Use QCC compiler id for the qcc drivers on QNX.", \ 3, 0, 0, NEW) \ SELECT(POLICY, CMP0048, "project() command manages VERSION variables.", 3, \ - 0, 0, WARN) \ + 0, 0, NEW) \ SELECT(POLICY, CMP0049, \ "Do not expand variables in target source entries.", 3, 0, 0, WARN) \ SELECT(POLICY, CMP0050, "Disallow add_custom_command SOURCE signatures.", \ diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index 5d854cd45e..0aa7bbd2f9 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -107,7 +107,6 @@ bool cmProjectCommand(std::vector const& args, bool haveLanguages = false; bool haveDescription = false; bool haveHomepage = false; - bool injectedProjectCommand = false; std::string version; std::string description; std::string homepage; @@ -198,8 +197,6 @@ bool cmProjectCommand(std::vector 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]; @@ -234,17 +231,7 @@ bool cmProjectCommand(std::vector const& args, languages.emplace_back("NONE"); } - cmPolicies::PolicyStatus const cmp0048 = - mf.GetPolicyStatus(cmPolicies::CMP0048); if (haveVersion) { - // Set project VERSION variables to given values - if (cmp0048 == cmPolicies::OLD || cmp0048 == cmPolicies::WARN) { - mf.IssueMessage(MessageType::FATAL_ERROR, - "VERSION not allowed unless CMP0048 is set to NEW"); - cmSystemTools::SetFatalErrorOccurred(); - return true; - } - cmsys::RegularExpression vx( R"(^([0-9]+(\.[0-9]+(\.[0-9]+(\.[0-9]+)?)?)?)?$)"); if (!vx.find(version)) { @@ -315,7 +302,7 @@ bool cmProjectCommand(std::vector const& args, version_components[2]); TopLevelCMakeVarCondSet(mf, "CMAKE_PROJECT_VERSION_TWEAK", version_components[3]); - } else if (cmp0048 != cmPolicies::OLD) { + } else { // Set project VERSION variables to empty std::vector vv = { "PROJECT_VERSION", "PROJECT_VERSION_MAJOR", @@ -334,26 +321,12 @@ bool cmProjectCommand(std::vector const& args, vv.emplace_back("CMAKE_PROJECT_VERSION_PATCH"); vv.emplace_back("CMAKE_PROJECT_VERSION_TWEAK"); } - std::string vw; for (std::string const& i : vv) { cmValue v = mf.GetDefinition(i); if (cmNonempty(v)) { - if (cmp0048 == cmPolicies::WARN) { - if (!injectedProjectCommand) { - vw += "\n "; - vw += i; - } - } else { - mf.AddDefinition(i, ""); - } + mf.AddDefinition(i, ""); } } - if (!vw.empty()) { - mf.IssueMessage( - MessageType::AUTHOR_WARNING, - cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0048), - "\nThe following variable(s) would be set to empty:", vw)); - } } mf.AddDefinition("PROJECT_DESCRIPTION", description); diff --git a/Tests/RunCMake/project/CMP0048-NEW-stderr.txt b/Tests/RunCMake/project/CMP0048-NEW-stderr.txt deleted file mode 100644 index b6c6b1fdf5..0000000000 --- a/Tests/RunCMake/project/CMP0048-NEW-stderr.txt +++ /dev/null @@ -1,7 +0,0 @@ -^CMake Deprecation Warning at CMakeLists\.txt:[0-9]+ \(cmake_minimum_required\): - Compatibility with CMake < 3\.10 will be removed from a future version of - CMake\. - - Update the VERSION argument value\. Or, use the \.\.\. syntax - to tell CMake that the project requires at least but has been updated - to work with policies introduced by or earlier\.$ diff --git a/Tests/RunCMake/project/CMP0048-NEW.cmake b/Tests/RunCMake/project/CMP0048-NEW.cmake index b6e80aca93..dbf99a7398 100644 --- a/Tests/RunCMake/project/CMP0048-NEW.cmake +++ b/Tests/RunCMake/project/CMP0048-NEW.cmake @@ -1,7 +1,5 @@ include(PrintVersions.cmake) -cmake_policy(SET CMP0048 NEW) - project(ProjectA VERSION 1.2.3.4 LANGUAGES NONE) print_versions(ProjectA) diff --git a/Tests/RunCMake/project/CMP0048-OLD-VERSION-result.txt b/Tests/RunCMake/project/CMP0048-OLD-VERSION-result.txt deleted file mode 100644 index d00491fd7e..0000000000 --- a/Tests/RunCMake/project/CMP0048-OLD-VERSION-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/project/CMP0048-OLD-VERSION-stderr.txt b/Tests/RunCMake/project/CMP0048-OLD-VERSION-stderr.txt deleted file mode 100644 index c11215a084..0000000000 --- a/Tests/RunCMake/project/CMP0048-OLD-VERSION-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -CMake Error at CMP0048-OLD-VERSION.cmake:1 \(project\): - VERSION not allowed unless CMP0048 is set to NEW -Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/project/CMP0048-OLD-VERSION.cmake b/Tests/RunCMake/project/CMP0048-OLD-VERSION.cmake deleted file mode 100644 index 6fbbe0a276..0000000000 --- a/Tests/RunCMake/project/CMP0048-OLD-VERSION.cmake +++ /dev/null @@ -1,2 +0,0 @@ -project(MyProject VERSION 1 LANGUAGES NONE) -message("This line not reached.") diff --git a/Tests/RunCMake/project/CMP0048-OLD-stderr.txt b/Tests/RunCMake/project/CMP0048-OLD-stderr.txt deleted file mode 100644 index 51e43f0958..0000000000 --- a/Tests/RunCMake/project/CMP0048-OLD-stderr.txt +++ /dev/null @@ -1,18 +0,0 @@ -^CMake Deprecation Warning at CMakeLists\.txt:[0-9]+ \(cmake_minimum_required\): - Compatibility with CMake < 3\.10 will be removed from a future version of - CMake\. - - Update the VERSION argument value\. Or, use the \.\.\. syntax - to tell CMake that the project requires at least but has been updated - to work with policies introduced by or earlier\. -+ -CMake Deprecation Warning at CMP0048-OLD\.cmake:1 \(cmake_policy\): - The OLD behavior for policy CMP0048 will be removed from a future version - of CMake\. - - The cmake-policies\(7\) manual explains that the OLD behaviors of all - policies are deprecated and that a policy should be set to OLD only under - specific short-term circumstances. Projects should be ported to the NEW - behavior and not rely on setting a policy to OLD. -Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/project/CMP0048-OLD-stdout.txt b/Tests/RunCMake/project/CMP0048-OLD-stdout.txt deleted file mode 100644 index 1a25c7bca4..0000000000 --- a/Tests/RunCMake/project/CMP0048-OLD-stdout.txt +++ /dev/null @@ -1,2 +0,0 @@ --- PROJECT_VERSION='1' --- MyProject_VERSION_TWEAK='0' diff --git a/Tests/RunCMake/project/CMP0048-OLD.cmake b/Tests/RunCMake/project/CMP0048-OLD.cmake deleted file mode 100644 index 6c32d2cc4f..0000000000 --- a/Tests/RunCMake/project/CMP0048-OLD.cmake +++ /dev/null @@ -1,6 +0,0 @@ -cmake_policy(SET CMP0048 OLD) -set(PROJECT_VERSION 1) -set(MyProject_VERSION_TWEAK 0) -project(MyProject NONE) -message(STATUS "PROJECT_VERSION='${PROJECT_VERSION}'") -message(STATUS "MyProject_VERSION_TWEAK='${MyProject_VERSION_TWEAK}'") diff --git a/Tests/RunCMake/project/CMP0048-WARN-stderr.txt b/Tests/RunCMake/project/CMP0048-WARN-stderr.txt deleted file mode 100644 index d9be5d3f90..0000000000 --- a/Tests/RunCMake/project/CMP0048-WARN-stderr.txt +++ /dev/null @@ -1,12 +0,0 @@ -CMake Warning \(dev\) at CMP0048-WARN.cmake:3 \(project\): - 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: - - PROJECT_VERSION - MyProject_VERSION_TWEAK -Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\) -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/project/CMP0048-WARN.cmake b/Tests/RunCMake/project/CMP0048-WARN.cmake deleted file mode 100644 index 97359e64fd..0000000000 --- a/Tests/RunCMake/project/CMP0048-WARN.cmake +++ /dev/null @@ -1,3 +0,0 @@ -set(PROJECT_VERSION 1) -set(MyProject_VERSION_TWEAK 0) -project(MyProject NONE) diff --git a/Tests/RunCMake/project/CMP0096-NEW.cmake b/Tests/RunCMake/project/CMP0096-NEW.cmake index e2cdd20019..2aa0468c0f 100644 --- a/Tests/RunCMake/project/CMP0096-NEW.cmake +++ b/Tests/RunCMake/project/CMP0096-NEW.cmake @@ -1,4 +1,3 @@ -cmake_policy(SET CMP0048 NEW) cmake_policy(SET CMP0096 NEW) include(CMP0096-common.cmake) diff --git a/Tests/RunCMake/project/CMP0096-OLD.cmake b/Tests/RunCMake/project/CMP0096-OLD.cmake index 25a3b19f9f..15e5140855 100644 --- a/Tests/RunCMake/project/CMP0096-OLD.cmake +++ b/Tests/RunCMake/project/CMP0096-OLD.cmake @@ -1,3 +1,2 @@ -cmake_policy(SET CMP0048 NEW) cmake_policy(SET CMP0096 OLD) include(CMP0096-common.cmake) diff --git a/Tests/RunCMake/project/CMP0096-WARN.cmake b/Tests/RunCMake/project/CMP0096-WARN.cmake index 7fe0861791..65b0d6e8df 100644 --- a/Tests/RunCMake/project/CMP0096-WARN.cmake +++ b/Tests/RunCMake/project/CMP0096-WARN.cmake @@ -1,3 +1 @@ -cmake_policy(SET CMP0048 NEW) - include(CMP0096-common.cmake) diff --git a/Tests/RunCMake/project/CMakeLists.txt b/Tests/RunCMake/project/CMakeLists.txt index 28146c4726..854b404210 100644 --- a/Tests/RunCMake/project/CMakeLists.txt +++ b/Tests/RunCMake/project/CMakeLists.txt @@ -1,7 +1,5 @@ if("x${RunCMake_TEST}" STREQUAL "xNoMinimumRequired") # No cmake_minimum_required(VERSION) -elseif(RunCMake_TEST MATCHES "^CMP0048") - cmake_minimum_required(VERSION 2.8.12) # old enough to not set CMP0048 else() cmake_minimum_required(VERSION 3.10) # CMP0180 needs to be set before the project() call for these tests diff --git a/Tests/RunCMake/project/ProjectDescription.cmake b/Tests/RunCMake/project/ProjectDescription.cmake index 3a47362231..47bd8c5851 100644 --- a/Tests/RunCMake/project/ProjectDescription.cmake +++ b/Tests/RunCMake/project/ProjectDescription.cmake @@ -1,4 +1,3 @@ -cmake_policy(SET CMP0048 NEW) project(ProjectDescriptionTest VERSION 1.0.0 DESCRIPTION "Test Project" LANGUAGES) if(NOT PROJECT_DESCRIPTION) message(FATAL_ERROR "PROJECT_DESCRIPTION expected to be set") diff --git a/Tests/RunCMake/project/ProjectDescription2.cmake b/Tests/RunCMake/project/ProjectDescription2.cmake index 3f186ba195..36b8ef11d0 100644 --- a/Tests/RunCMake/project/ProjectDescription2.cmake +++ b/Tests/RunCMake/project/ProjectDescription2.cmake @@ -1,2 +1 @@ -cmake_policy(SET CMP0048 NEW) project(ProjectDescriptionTest VERSION 1.0.0 DESCRIPTION "Test Project" DESCRIPTION "Only once allowed" LANGUAGES) diff --git a/Tests/RunCMake/project/ProjectDescriptionNoArg.cmake b/Tests/RunCMake/project/ProjectDescriptionNoArg.cmake index 25acff8408..76d1051589 100644 --- a/Tests/RunCMake/project/ProjectDescriptionNoArg.cmake +++ b/Tests/RunCMake/project/ProjectDescriptionNoArg.cmake @@ -1,2 +1 @@ -cmake_policy(SET CMP0048 NEW) project(ProjectDescriptionTest VERSION 1.0.0 LANGUAGES NONE DESCRIPTION) diff --git a/Tests/RunCMake/project/ProjectDescriptionNoArg2.cmake b/Tests/RunCMake/project/ProjectDescriptionNoArg2.cmake index f50a2f688a..ed09af4f25 100644 --- a/Tests/RunCMake/project/ProjectDescriptionNoArg2.cmake +++ b/Tests/RunCMake/project/ProjectDescriptionNoArg2.cmake @@ -1,2 +1 @@ -cmake_policy(SET CMP0048 NEW) project(ProjectDescriptionTest VERSION 1.0.0 DESCRIPTION LANGUAGES NONE) diff --git a/Tests/RunCMake/project/ProjectHomepage.cmake b/Tests/RunCMake/project/ProjectHomepage.cmake index 3307f1fc9d..140b2bbdde 100644 --- a/Tests/RunCMake/project/ProjectHomepage.cmake +++ b/Tests/RunCMake/project/ProjectHomepage.cmake @@ -1,4 +1,3 @@ -cmake_policy(SET CMP0048 NEW) project(ProjectHomepageTest VERSION 1.0.0 HOMEPAGE_URL "http://example.com" LANGUAGES) if(NOT PROJECT_HOMEPAGE_URL) message(FATAL_ERROR "PROJECT_HOMEPAGE_URL expected to be set") diff --git a/Tests/RunCMake/project/ProjectHomepage2-stderr.txt b/Tests/RunCMake/project/ProjectHomepage2-stderr.txt index 4a0adc2d31..fe2226361a 100644 --- a/Tests/RunCMake/project/ProjectHomepage2-stderr.txt +++ b/Tests/RunCMake/project/ProjectHomepage2-stderr.txt @@ -1,4 +1,4 @@ -^CMake Error at ProjectHomepage2.cmake:2 \(project\): +^CMake Error at ProjectHomepage2.cmake:[0-9]+ \(project\): HOMEPAGE_URL may be specified at most once. Call Stack \(most recent call first\): CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/project/ProjectHomepage2.cmake b/Tests/RunCMake/project/ProjectHomepage2.cmake index 184c392c4a..28b8ae7dfb 100644 --- a/Tests/RunCMake/project/ProjectHomepage2.cmake +++ b/Tests/RunCMake/project/ProjectHomepage2.cmake @@ -1,2 +1 @@ -cmake_policy(SET CMP0048 NEW) project(ProjectDescriptionTest VERSION 1.0.0 HOMEPAGE_URL "http://example.com" HOMEPAGE_URL "http://example.com" LANGUAGES) diff --git a/Tests/RunCMake/project/ProjectHomepageNoArg-stderr.txt b/Tests/RunCMake/project/ProjectHomepageNoArg-stderr.txt index c9503b74b7..b1823ee91a 100644 --- a/Tests/RunCMake/project/ProjectHomepageNoArg-stderr.txt +++ b/Tests/RunCMake/project/ProjectHomepageNoArg-stderr.txt @@ -1,4 +1,4 @@ -^CMake Warning at ProjectHomepageNoArg.cmake:2 \(project\): +^CMake Warning at ProjectHomepageNoArg.cmake:[0-9]+ \(project\): HOMEPAGE_URL keyword not followed by a value or was followed by a value that expanded to nothing. Call Stack \(most recent call first\): diff --git a/Tests/RunCMake/project/ProjectHomepageNoArg.cmake b/Tests/RunCMake/project/ProjectHomepageNoArg.cmake index 460554194b..4be2fbf3df 100644 --- a/Tests/RunCMake/project/ProjectHomepageNoArg.cmake +++ b/Tests/RunCMake/project/ProjectHomepageNoArg.cmake @@ -1,2 +1 @@ -cmake_policy(SET CMP0048 NEW) project(ProjectDescriptionTest VERSION 1.0.0 LANGUAGES NONE HOMEPAGE_URL) diff --git a/Tests/RunCMake/project/ProjectTwice.cmake b/Tests/RunCMake/project/ProjectTwice.cmake index d053834dc4..66dcb9f30e 100644 --- a/Tests/RunCMake/project/ProjectTwice.cmake +++ b/Tests/RunCMake/project/ProjectTwice.cmake @@ -1,4 +1,3 @@ -cmake_policy(SET CMP0048 NEW) project(ProjectTwiceTestFirst VERSION 1.2.3.4 DESCRIPTION "Test Project" diff --git a/Tests/RunCMake/project/RunCMakeTest.cmake b/Tests/RunCMake/project/RunCMakeTest.cmake index 554cdff673..11f2b028b3 100644 --- a/Tests/RunCMake/project/RunCMakeTest.cmake +++ b/Tests/RunCMake/project/RunCMakeTest.cmake @@ -53,9 +53,6 @@ run_cmake(VersionMissingValueOkay) run_cmake(VersionTwice) run_cmake(VersionMax) -run_cmake(CMP0048-OLD) -run_cmake(CMP0048-OLD-VERSION) -run_cmake(CMP0048-WARN) run_cmake(CMP0048-NEW) run_cmake(CMP0096-WARN) diff --git a/Tests/RunCMake/project/VersionAndLanguagesEmpty.cmake b/Tests/RunCMake/project/VersionAndLanguagesEmpty.cmake index d6056ce1b7..610d8c2586 100644 --- a/Tests/RunCMake/project/VersionAndLanguagesEmpty.cmake +++ b/Tests/RunCMake/project/VersionAndLanguagesEmpty.cmake @@ -1,4 +1,3 @@ -cmake_policy(SET CMP0048 NEW) project(ProjectA VERSION 1 LANGUAGES NONE) get_property(langs GLOBAL PROPERTY ENABLED_LANGUAGES) message(STATUS "ENABLED_LANGUAGES='${langs}'") diff --git a/Tests/RunCMake/project/VersionEmpty.cmake b/Tests/RunCMake/project/VersionEmpty.cmake index 0cfb29140f..93993f6443 100644 --- a/Tests/RunCMake/project/VersionEmpty.cmake +++ b/Tests/RunCMake/project/VersionEmpty.cmake @@ -1,4 +1,3 @@ -cmake_policy(SET CMP0048 NEW) set(PROJECT_VERSION 1) project(ProjectA VERSION "" LANGUAGES NONE) get_property(langs GLOBAL PROPERTY ENABLED_LANGUAGES) diff --git a/Tests/RunCMake/project/VersionInvalid-stderr.txt b/Tests/RunCMake/project/VersionInvalid-stderr.txt index e13a38228f..f5b9ccfc21 100644 --- a/Tests/RunCMake/project/VersionInvalid-stderr.txt +++ b/Tests/RunCMake/project/VersionInvalid-stderr.txt @@ -1,4 +1,4 @@ -CMake Error at VersionInvalid.cmake:2 \(project\): +CMake Error at VersionInvalid.cmake:[0-9]+ \(project\): VERSION "NONE" format invalid. Call Stack \(most recent call first\): CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/project/VersionInvalid.cmake b/Tests/RunCMake/project/VersionInvalid.cmake index 8d5dd7f255..fbb11e23f8 100644 --- a/Tests/RunCMake/project/VersionInvalid.cmake +++ b/Tests/RunCMake/project/VersionInvalid.cmake @@ -1,3 +1,2 @@ -cmake_policy(SET CMP0048 NEW) project(ProjectA VERSION NONE) message("This line not reached.") diff --git a/Tests/RunCMake/project/VersionMax.cmake b/Tests/RunCMake/project/VersionMax.cmake index e955364384..13686819de 100644 --- a/Tests/RunCMake/project/VersionMax.cmake +++ b/Tests/RunCMake/project/VersionMax.cmake @@ -1,4 +1,3 @@ -cmake_policy(SET CMP0048 NEW) cmake_policy(SET CMP0096 OLD) enable_language(C) diff --git a/Tests/RunCMake/project/VersionMissingLanguages-stderr.txt b/Tests/RunCMake/project/VersionMissingLanguages-stderr.txt index 63cbf63a57..b169965fb3 100644 --- a/Tests/RunCMake/project/VersionMissingLanguages-stderr.txt +++ b/Tests/RunCMake/project/VersionMissingLanguages-stderr.txt @@ -1,4 +1,4 @@ -CMake Error at VersionMissingLanguages.cmake:2 \(project\): +CMake Error at VersionMissingLanguages.cmake:[0-9]+ \(project\): project with VERSION, DESCRIPTION or HOMEPAGE_URL must use LANGUAGES before language names. Call Stack \(most recent call first\): diff --git a/Tests/RunCMake/project/VersionMissingLanguages.cmake b/Tests/RunCMake/project/VersionMissingLanguages.cmake index dc415141c8..72d29f0ef8 100644 --- a/Tests/RunCMake/project/VersionMissingLanguages.cmake +++ b/Tests/RunCMake/project/VersionMissingLanguages.cmake @@ -1,3 +1,2 @@ -cmake_policy(SET CMP0048 NEW) project(ProjectA VERSION 1 NONE) message("This line not reached.") diff --git a/Tests/RunCMake/project/VersionMissingValueOkay.cmake b/Tests/RunCMake/project/VersionMissingValueOkay.cmake index 1fb1437501..3a6cf6fd50 100644 --- a/Tests/RunCMake/project/VersionMissingValueOkay.cmake +++ b/Tests/RunCMake/project/VersionMissingValueOkay.cmake @@ -1,4 +1,3 @@ -cmake_policy(SET CMP0048 NEW) set(PROJECT_VERSION 1) project(ProjectA VERSION LANGUAGES NONE) get_property(langs GLOBAL PROPERTY ENABLED_LANGUAGES) diff --git a/Tests/RunCMake/project/VersionTwice-stderr.txt b/Tests/RunCMake/project/VersionTwice-stderr.txt index dc055331b5..9fa87a8f4e 100644 --- a/Tests/RunCMake/project/VersionTwice-stderr.txt +++ b/Tests/RunCMake/project/VersionTwice-stderr.txt @@ -1,4 +1,4 @@ -CMake Error at VersionTwice.cmake:2 \(project\): +CMake Error at VersionTwice.cmake:[0-9]+ \(project\): VERSION may be specified at most once. Call Stack \(most recent call first\): CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/project/VersionTwice.cmake b/Tests/RunCMake/project/VersionTwice.cmake index dc0c996cfa..5f6099929a 100644 --- a/Tests/RunCMake/project/VersionTwice.cmake +++ b/Tests/RunCMake/project/VersionTwice.cmake @@ -1,3 +1,2 @@ -cmake_policy(SET CMP0048 NEW) project(ProjectA VERSION 1 VERSION) message("This line not reached.") diff --git a/Tests/RunCMake/project_injected/CMakeLists.txt b/Tests/RunCMake/project_injected/CMakeLists.txt index 1b4931b8fc..dc4c49ffe7 100644 --- a/Tests/RunCMake/project_injected/CMakeLists.txt +++ b/Tests/RunCMake/project_injected/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.12.2) # old enough to not set CMP0048 +cmake_minimum_required(VERSION 3.10) # no project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/project_injected/CMP0048-WARN-stderr.txt b/Tests/RunCMake/project_injected/Inject-stderr.txt similarity index 53% rename from Tests/RunCMake/project_injected/CMP0048-WARN-stderr.txt rename to Tests/RunCMake/project_injected/Inject-stderr.txt index 38ec91fa47..c6533b32ea 100644 --- a/Tests/RunCMake/project_injected/CMP0048-WARN-stderr.txt +++ b/Tests/RunCMake/project_injected/Inject-stderr.txt @@ -9,12 +9,4 @@ CMake is pretending there is a "project\(Project\)" command on the first line\. -This warning is for project developers. Use -Wno-dev to suppress it\. -+ -CMake Deprecation Warning at CMakeLists\.txt:1 \(cmake_minimum_required\): - Compatibility with CMake < 3\.10 will be removed from a future version of - CMake\. - - Update the VERSION argument value\. Or, use the \.\.\. syntax - to tell CMake that the project requires at least but has been updated - to work with policies introduced by or earlier\.$ +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/Inject.cmake similarity index 100% rename from Tests/RunCMake/project_injected/CMP0048-WARN.cmake rename to Tests/RunCMake/project_injected/Inject.cmake diff --git a/Tests/RunCMake/project_injected/RunCMakeTest.cmake b/Tests/RunCMake/project_injected/RunCMakeTest.cmake index cf63e12d28..9410b3d6ad 100644 --- a/Tests/RunCMake/project_injected/RunCMakeTest.cmake +++ b/Tests/RunCMake/project_injected/RunCMakeTest.cmake @@ -9,5 +9,5 @@ set(RunCMake_TEST_OPTIONS -DCMAKE_PROJECT_VERSION_MINOR:STATIC=2 -DCMAKE_PROJECT_VERSION_PATCH:STATIC=3 ) -run_cmake(CMP0048-WARN) +run_cmake(Inject) unset(RunCMake_TEST_OPTIONS)