[Cmake-commits] CMake branch, next, updated. v2.8.3-1164-g95c4524
Brad King
brad.king at kitware.com
Tue Jan 4 08:11:08 EST 2011
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 95c45241560212ad77cd6ae47d4bea322f218dc0 (commit)
via 0319368c601c0944fe1162c5992a7a009261f9e6 (commit)
via 528eec02c93452882ae609debd3c3773f37ca8fa (commit)
via e028a3f534da8c7f66b5d8574fc50f7d2c234bd5 (commit)
via ab34f3acc29078a90c4d71481e2475c270b88a03 (commit)
via 4c45e0dede53fda66f3c7cf199b6d61bc1f53dd8 (commit)
from f3d1d7e4a9fed74521e8ec14371e9466e731db6b (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=95c45241560212ad77cd6ae47d4bea322f218dc0
commit 95c45241560212ad77cd6ae47d4bea322f218dc0
Merge: f3d1d7e 0319368
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Jan 4 08:10:59 2011 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jan 4 08:10:59 2011 -0500
Merge topic 'PreferCMakeModulesByCMakeModulesWithPolicy-NoTrailingWhitespaceCommit' into next
0319368 Merge branch 'include-command-whitespace' into PreferCMakeModulesByCMakeModulesWithPolicy-NoTrailingWhitespaceCommit
528eec0 Revert "Prefer files from CMAKE_ROOT when including from CMAKE_ROOT."
e028a3f Revert "Fix indentation in cmPolicies::ApplyPolicyVersion()"
ab34f3a Revert "Add support for CMAKE_POLICY_DEFAULT_CMP<NNNN> variables."
4c45e0d Revert "Add comment about CMP0017 to docs of include()"
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0319368c601c0944fe1162c5992a7a009261f9e6
commit 0319368c601c0944fe1162c5992a7a009261f9e6
Merge: 528eec0 75a5221
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Jan 4 08:04:03 2011 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Jan 4 08:04:03 2011 -0500
Merge branch 'include-command-whitespace' into PreferCMakeModulesByCMakeModulesWithPolicy-NoTrailingWhitespaceCommit
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=528eec02c93452882ae609debd3c3773f37ca8fa
commit 528eec02c93452882ae609debd3c3773f37ca8fa
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Jan 4 07:58:29 2011 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Jan 4 07:58:29 2011 -0500
Revert "Prefer files from CMAKE_ROOT when including from CMAKE_ROOT."
This reverts commit 07410f329d8a219fc8c6153212cdcdb6034ab27c.
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index ccf4d7a..56e0ed9 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2822,100 +2822,35 @@ void cmMakefile::DisplayStatus(const char* message, float s)
std::string cmMakefile::GetModulesFile(const char* filename)
{
- std::string result;
-
- // We search the module always in CMAKE_ROOT and in CMAKE_MODULE_PATH,
- // and then decide based on the policy setting which one to return.
- // See CMP0017 for more details.
- // The specific problem was that KDE 4.5.0 installs a
- // FindPackageHandleStandardArgs.cmake which doesn't have the new features
- // of FPHSA.cmake introduced in CMake 2.8.3 yet, and by setting
- // CMAKE_MODULE_PATH also e.g. FindZLIB.cmake from cmake included
- // FPHSA.cmake from kdelibs and not from CMake, and tried to use the
- // new features, which were not there in the version from kdelibs, and so
- // failed ("
- std::string moduleInCMakeRoot;
- std::string moduleInCMakeModulePath;
-
- // Always search in CMAKE_MODULE_PATH:
- const char* cmakeModulePath = this->GetDefinition("CMAKE_MODULE_PATH");
- if(cmakeModulePath)
- {
- std::vector<std::string> modulePath;
- cmSystemTools::ExpandListArgument(cmakeModulePath, modulePath);
-
- //Look through the possible module directories.
- for(std::vector<std::string>::iterator i = modulePath.begin();
- i != modulePath.end(); ++i)
- {
- std::string itempl = *i;
- cmSystemTools::ConvertToUnixSlashes(itempl);
- itempl += "/";
- itempl += filename;
- if(cmSystemTools::FileExists(itempl.c_str()))
- {
- moduleInCMakeModulePath = itempl;
- break;
- }
- }
- }
-
- // Always search in the standard modules location.
- const char* cmakeRoot = this->GetDefinition("CMAKE_ROOT");
- if(cmakeRoot)
+ std::vector<std::string> modulePath;
+ const char* def = this->GetDefinition("CMAKE_MODULE_PATH");
+ if(def)
{
- moduleInCMakeRoot = cmakeRoot;
- moduleInCMakeRoot += "/Modules/";
- moduleInCMakeRoot += filename;
- cmSystemTools::ConvertToUnixSlashes(moduleInCMakeRoot);
- if(!cmSystemTools::FileExists(moduleInCMakeRoot.c_str()))
- {
- moduleInCMakeRoot = "";
- }
+ cmSystemTools::ExpandListArgument(def, modulePath);
}
- // Normally, prefer the files found in CMAKE_MODULE_PATH. Only when the file
- // from which we are being called is located itself in CMAKE_ROOT, then
- // prefer results from CMAKE_ROOT depending on the policy setting.
- result = moduleInCMakeModulePath;
- if (result.size() == 0)
+ // Also search in the standard modules location.
+ def = this->GetDefinition("CMAKE_ROOT");
+ if(def)
{
- result = moduleInCMakeRoot;
+ std::string rootModules = def;
+ rootModules += "/Modules";
+ modulePath.push_back(rootModules);
}
-
- if ((moduleInCMakeModulePath.size()>0) && (moduleInCMakeRoot.size()>0))
+ //std::string Look through the possible module directories.
+ for(std::vector<std::string>::iterator i = modulePath.begin();
+ i != modulePath.end(); ++i)
{
- const char* currentFile = this->GetDefinition("CMAKE_CURRENT_LIST_FILE");
- if (currentFile && (strstr(currentFile, cmakeRoot) == currentFile))
+ std::string itempl = *i;
+ cmSystemTools::ConvertToUnixSlashes(itempl);
+ itempl += "/";
+ itempl += filename;
+ if(cmSystemTools::FileExists(itempl.c_str()))
{
- switch (this->GetPolicyStatus(cmPolicies::CMP0017))
- {
- case cmPolicies::WARN:
- {
- cmOStringStream e;
- e << "File " << currentFile << " includes "
- << moduleInCMakeModulePath
- << " (found via CMAKE_MODULE_PATH) which shadows "
- << moduleInCMakeRoot << ". This may cause errors later on .\n"
- << this->GetPolicies()->GetPolicyWarning(cmPolicies::CMP0017);
-
- this->IssueMessage(cmake::AUTHOR_WARNING, e.str());
- // break; // fall through to OLD behaviour
- }
- case cmPolicies::OLD:
- result = moduleInCMakeModulePath;
- break;
- case cmPolicies::REQUIRED_IF_USED:
- case cmPolicies::REQUIRED_ALWAYS:
- case cmPolicies::NEW:
- default:
- result = moduleInCMakeRoot;
- break;
- }
+ return itempl;
}
}
-
- return result;
+ return "";
}
void cmMakefile::ConfigureString(const std::string& input,
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 8e9ac6d..3fe92de 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -446,22 +446,6 @@ cmPolicies::cmPolicies()
"wasn't a valid target. "
"In CMake 2.8.3 and above it reports an error in this case.",
2,8,3,0, cmPolicies::WARN);
-
- this->DefinePolicy(
- CMP0017, "CMP0017",
- "Prefer files from CMAKE_ROOT/ when including from CMAKE_ROOT.",
- "Starting with CMake 2.8.3, if a cmake-module shipped with CMake (i.e. "
- "located in CMAKE_ROOT/Modules/) calls include() or find_package(), "
- "the files located in CMAKE_ROOT/Modules/ are prefered over the files "
- "in CMAKE_MODULE_PATH. This makes sure that the modules belonging to "
- "CMake always get those files included which they expect, and against "
- "which they were developed and tested. "
- "In call other cases, the files found in "
- "CMAKE_MODULE_PATH still take precedence over the ones in "
- "CMAKE_ROOT/Modules/. "
- "The OLD behaviour is to always prefer files from CMAKE_MODULE_PATH over "
- "files from CMAKE_ROOT/Modules/.",
- 2,8,3,0, cmPolicies::WARN);
}
cmPolicies::~cmPolicies()
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 2bb16a2..fce33ac 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -52,7 +52,6 @@ public:
CMP0014, // Input directories must have CMakeLists.txt
CMP0015, // link_directories() treats paths relative to source dir
CMP0016, // target_link_libraries() fails if only argument is not a target
- CMP0017, // Prefer files in CMAKE_ROOT when including from CMAKE_ROOT
// Always the last entry. Useful mostly to avoid adding a comma
// the last policy when adding a new one.
diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt
index fb12121..a472bea 100644
--- a/Tests/FindPackageTest/CMakeLists.txt
+++ b/Tests/FindPackageTest/CMakeLists.txt
@@ -1,15 +1,6 @@
cmake_minimum_required (VERSION 2.6)
PROJECT(FindPackageTest)
-LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
-
-# Look for a package which uses FindPackageHandleStandardArgs.cmake with the
-# new (as of cmake 2.8.3) syntax. This works only if CMP0017 is set to NEW,
-# because otherwise FindPackageHandleStandardArgs.cmake from the current
-# directory is included (via CMAKE_MODULE_PATH).
-CMAKE_POLICY(SET CMP0017 NEW)
-FIND_PACKAGE(ZLIB)
-
# Look for a package that has a find module and may be found.
FIND_PACKAGE(OpenGL QUIET)
@@ -32,6 +23,7 @@ IF(NOT FOO_DIR)
CMAKE_PREFIX_PATH = ${CMAKE_PREFIX_PATH}")
ENDIF(NOT FOO_DIR)
+LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
FIND_PACKAGE(VersionTestA 1)
FIND_PACKAGE(VersionTestB 1.2)
FIND_PACKAGE(VersionTestC 1.2.3)
diff --git a/Tests/FindPackageTest/FindPackageHandleStandardArgs.cmake b/Tests/FindPackageTest/FindPackageHandleStandardArgs.cmake
deleted file mode 100644
index 7e41c96..0000000
--- a/Tests/FindPackageTest/FindPackageHandleStandardArgs.cmake
+++ /dev/null
@@ -1 +0,0 @@
-message(FATAL_ERROR "This file (${CMAKE_CURRENT_LIST_FILE}) must not be included, but FindPackageHandleStandardArgs.cmake from Modules/ instead !")
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e028a3f534da8c7f66b5d8574fc50f7d2c234bd5
commit e028a3f534da8c7f66b5d8574fc50f7d2c234bd5
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Jan 4 07:58:23 2011 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Jan 4 07:58:23 2011 -0500
Revert "Fix indentation in cmPolicies::ApplyPolicyVersion()"
This reverts commit 15712e2be89983e6be8a3d4b3a20966163266c00.
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 1183ba1..8e9ac6d 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -511,9 +511,9 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf,
std::string ver = "2.4.0";
if (version && strlen(version) > 0)
- {
+ {
ver = version;
- }
+ }
unsigned int majorVer = 2;
unsigned int minorVer = 0;
@@ -572,28 +572,29 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf,
// now loop over all the policies and set them as appropriate
std::vector<cmPolicies::PolicyID> ancientPolicies;
- for(std::map<cmPolicies::PolicyID,cmPolicy *>::iterator i
- = this->Policies.begin(); i != this->Policies.end(); ++i)
+ std::map<cmPolicies::PolicyID,cmPolicy *>::iterator i
+ = this->Policies.begin();
+ for (;i != this->Policies.end(); ++i)
+ {
+ if (i->second->IsPolicyNewerThan(majorVer,minorVer,patchVer,tweakVer))
{
- if (i->second->IsPolicyNewerThan(majorVer,minorVer,patchVer,tweakVer))
- {
if(i->second->Status == cmPolicies::REQUIRED_ALWAYS)
- {
+ {
ancientPolicies.push_back(i->first);
- }
+ }
else if (!mf->SetPolicy(i->second->ID, cmPolicies::WARN))
- {
+ {
return false;
- }
}
+ }
else
- {
+ {
if (!mf->SetPolicy(i->second->ID, cmPolicies::NEW))
- {
+ {
return false;
- }
}
}
+ }
// Make sure the project does not use any ancient policies.
if(!ancientPolicies.empty())
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ab34f3acc29078a90c4d71481e2475c270b88a03
commit ab34f3acc29078a90c4d71481e2475c270b88a03
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Jan 4 07:58:17 2011 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Jan 4 07:58:17 2011 -0500
Revert "Add support for CMAKE_POLICY_DEFAULT_CMP<NNNN> variables."
This reverts commit eb74f519e90d880ed895ea2243aae2d64c2ba8f4.
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 692ef69..1183ba1 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -581,44 +581,9 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf,
{
ancientPolicies.push_back(i->first);
}
- else
+ else if (!mf->SetPolicy(i->second->ID, cmPolicies::WARN))
{
- // By default, all policies which did not exist in older cmake versions
- // will be set to WARN. This can be overridden using
- // CMAKE_POLICY_DEFAULT_CMP<NNNN> variables. In some case this is
- // necessary to keep old projects building.
- cmPolicies::PolicyStatus policyStatus = cmPolicies::WARN;
-
- std::string defaultPolicySettingVar = "CMAKE_POLICY_DEFAULT_";
- defaultPolicySettingVar += i->second->IDString;
- std::string defaultPolicySetting = mf->GetSafeDefinition(
- defaultPolicySettingVar.c_str());
-
- if (defaultPolicySetting.size() > 0)
- {
- if (defaultPolicySetting == "NEW")
- {
- policyStatus = cmPolicies::NEW;
- }
- else if (defaultPolicySetting == "OLD")
- {
- policyStatus = cmPolicies::OLD;
- }
- else
- {
- cmOStringStream e;
- e << "Requested to set policy " << i->second->IDString << " to "
- << defaultPolicySetting << ", but only NEW and OLD can be used."
- << "\n";
- mf->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
- return false;
- }
- }
-
- if (!mf->SetPolicy(i->second->ID, policyStatus))
- {
- return false;
- }
+ return false;
}
}
else
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4c45e0dede53fda66f3c7cf199b6d61bc1f53dd8
commit 4c45e0dede53fda66f3c7cf199b6d61bc1f53dd8
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Jan 4 07:58:10 2011 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Jan 4 07:58:10 2011 -0500
Revert "Add comment about CMP0017 to docs of include()"
This reverts commit a924ee511a33963fdce693b77982131df481df8f.
diff --git a/Source/cmIncludeCommand.h b/Source/cmIncludeCommand.h
index a6d43ba..8704750 100644
--- a/Source/cmIncludeCommand.h
+++ b/Source/cmIncludeCommand.h
@@ -73,12 +73,7 @@ public:
"the variable will be set to the full filename which "
"has been included or NOTFOUND if it failed.\n"
"If a module is specified instead of a file, the file with name "
- "<modulename>.cmake is searched first in CMAKE_MODULE_PATH, then in the "
- "CMake module directory. There is one exception to this: if the file "
- "which calls include() is located itself in the CMake module directory, "
- "then first the CMake module directory is searched and "
- "CMAKE_MODULE_PATH afterwards. This behaviour is controlled by policy "
- "CMP0017."
+ "<modulename>.cmake is searched in the CMAKE_MODULE_PATH."
"\n"
"See the cmake_policy() command documentation for discussion of the "
"NO_POLICY_SCOPE option."
-----------------------------------------------------------------------
Summary of changes:
Source/cmIncludeCommand.h | 7 +-
Source/cmMakefile.cxx | 105 ++++----------------
Source/cmPolicies.cxx | 82 +++------------
Source/cmPolicies.h | 1 -
Tests/FindPackageTest/CMakeLists.txt | 10 +--
.../FindPackageHandleStandardArgs.cmake | 1 -
6 files changed, 38 insertions(+), 168 deletions(-)
delete mode 100644 Tests/FindPackageTest/FindPackageHandleStandardArgs.cmake
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list