[Cmake-commits] [cmake-commits] hoffman committed cmCMakeMinimumRequired.cxx 1.17 1.17.2.1 cmCMakePolicyCommand.cxx 1.2 1.2.2.1 cmComputeLinkInformation.cxx 1.24.2.1 1.24.2.2 cmCoreTryCompile.cxx 1.7 1.7.2.1 cmGlobalUnixMakefileGenerator3.cxx 1.126 1.126.2.1 cmIfCommand.cxx 1.84 1.84.2.1 cmIfCommand.h 1.46 1.46.2.1 cmListFileCache.cxx 1.41 1.41.2.1 cmLocalUnixMakefileGenerator3.cxx 1.240.2.1 1.240.2.2 cmPolicies.cxx 1.20.2.1 1.20.2.2 cmake.cxx 1.375 1.375.2.1 cmake.h 1.109 1.109.2.1
cmake-commits at cmake.org
cmake-commits at cmake.org
Mon Mar 24 18:23:28 EDT 2008
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv2066/Source
Modified Files:
Tag: CMake-2-6
cmCMakeMinimumRequired.cxx cmCMakePolicyCommand.cxx
cmComputeLinkInformation.cxx cmCoreTryCompile.cxx
cmGlobalUnixMakefileGenerator3.cxx cmIfCommand.cxx
cmIfCommand.h cmListFileCache.cxx
cmLocalUnixMakefileGenerator3.cxx cmPolicies.cxx cmake.cxx
cmake.h
Log Message:
ENH: merge in from CVS
Index: cmListFileCache.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmListFileCache.cxx,v
retrieving revision 1.41
retrieving revision 1.41.2.1
diff -C 2 -d -r1.41 -r1.41.2.1
*** cmListFileCache.cxx 13 Mar 2008 17:48:57 -0000 1.41
--- cmListFileCache.cxx 24 Mar 2008 22:23:26 -0000 1.41.2.1
***************
*** 20,23 ****
--- 20,24 ----
#include "cmSystemTools.h"
#include "cmMakefile.h"
+ #include "cmVersion.h"
#include <cmsys/RegularExpression.hxx>
***************
*** 122,126 ****
if(topLevel)
{
! bool hasPolicy = false;
// search for the right policy command
for(std::vector<cmListFileFunction>::iterator i
--- 123,127 ----
if(topLevel)
{
! bool hasVersion = false;
// search for the right policy command
for(std::vector<cmListFileFunction>::iterator i
***************
*** 128,163 ****
i != this->Functions.end(); ++i)
{
- if (cmSystemTools::LowerCase(i->Name) == "cmake_policy" &&
- i->Arguments.size() &&
- cmSystemTools::LowerCase(i->Arguments[0].Value) == "version")
- {
- hasPolicy = true;
- break;
- }
if (cmSystemTools::LowerCase(i->Name) == "cmake_minimum_required")
{
! hasPolicy = true;
break;
}
}
! // if no policy command is found this is an error
! if(!hasPolicy)
{
! switch (mf->GetPolicyStatus(cmPolicies::CMP0000))
{
case cmPolicies::WARN:
! mf->IssueMessage(cmake::AUTHOR_WARNING,
! mf->GetPolicies()->GetPolicyWarning(cmPolicies::CMP0000)
! );
!
// Implicitly set the version for the user.
mf->SetPolicyVersion("2.4");
! case cmPolicies::OLD:
! break;
default:
! mf->IssueMessage(cmake::FATAL_ERROR,
! mf->GetPolicies()->GetRequiredPolicyError(cmPolicies::CMP0000)
! );
return false;
}
}
--- 129,199 ----
i != this->Functions.end(); ++i)
{
if (cmSystemTools::LowerCase(i->Name) == "cmake_minimum_required")
{
! hasVersion = true;
break;
}
}
! // if no policy command is found this is an error if they use any non advanced functions or a lot of functions
! if(!hasVersion)
{
! bool isProblem = true;
! if (this->Functions.size() < 30)
! {
! // the list of simple commands DO NOT ADD TO THIS LIST!!!!!
! // these commands must have backwards compatibility forever and
! // and that is a lot longer than your tiny mind can comprehend mortal
! std::set<std::string> allowedCommands;
! allowedCommands.insert("project");
! allowedCommands.insert("set");
! allowedCommands.insert("if");
! allowedCommands.insert("endif");
! allowedCommands.insert("else");
! allowedCommands.insert("elseif");
! allowedCommands.insert("add_executable");
! allowedCommands.insert("add_library");
! allowedCommands.insert("target_link_libraries");
! allowedCommands.insert("option");
! allowedCommands.insert("message");
! isProblem = false;
! for(std::vector<cmListFileFunction>::iterator i
! = this->Functions.begin();
! i != this->Functions.end(); ++i)
! {
! std::string name = cmSystemTools::LowerCase(i->Name);
! if (allowedCommands.find(name) == allowedCommands.end())
! {
! isProblem = true;
! break;
! }
! }
! }
!
! if (isProblem)
{
+ cmOStringStream msg;
+ msg << "No cmake_minimum_required command is present. "
+ << "A line of code such as\n"
+ << " cmake_minimum_required(VERSION "
+ << cmVersion::GetMajorVersion() << "."
+ << cmVersion::GetMinorVersion()
+ << ")\n"
+ << "should be added at the top of the file. "
+ << "The version specified may be lower if you wish to "
+ << "support older CMake versions for this project. "
+ << "For more information run "
+ << "\"cmake --help-policy CMP0000\".";
+ switch (mf->GetPolicyStatus(cmPolicies::CMP0000))
+ {
case cmPolicies::WARN:
! mf->IssueMessage(cmake::AUTHOR_WARNING, msg.str().c_str());
! case cmPolicies::OLD:
// Implicitly set the version for the user.
mf->SetPolicyVersion("2.4");
! break;
default:
! mf->IssueMessage(cmake::FATAL_ERROR, msg.str().c_str());
return false;
+ }
}
}
Index: cmPolicies.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmPolicies.cxx,v
retrieving revision 1.20.2.1
retrieving revision 1.20.2.2
diff -C 2 -d -r1.20.2.1 -r1.20.2.2
*** cmPolicies.cxx 18 Mar 2008 14:23:54 -0000 1.20.2.1
--- cmPolicies.cxx 24 Mar 2008 22:23:26 -0000 1.20.2.2
***************
*** 88,110 ****
this->DefinePolicy(
CMP0000, "CMP0000",
! "A policy version number must be specified.",
"CMake requires that projects specify the version of CMake to which "
"they have been written. "
! "This policy has been put in place to help existing projects build with "
! "new CMake versions as it evolves. "
! "The easiest way to specify a policy version number is to "
! "call the cmake_minimum_required command at the top of "
! "your CMakeLists.txt file:\n"
" cmake_minimum_required(VERSION <major>.<minor>)\n"
"where \"<major>.<minor>\" is the version of CMake you want to support "
"(such as \"2.6\"). "
"The command will ensure that at least the given version of CMake is "
! "running and set the policy version. "
! "See documentation of cmake_minimum_required for details. "
! "The cmake_policy command may be used at any time to set the "
! "policy version:\n"
! " cmake_policy(VERSION <major>.<minor>)\n"
! "This is the recommended way to set the policy version except at "
! "the very top of a project.",
2,6,0, cmPolicies::WARN
);
--- 88,106 ----
this->DefinePolicy(
CMP0000, "CMP0000",
! "A minimum required CMake version must be specified.",
"CMake requires that projects specify the version of CMake to which "
"they have been written. "
! "This policy has been put in place so users trying to build the project "
! "may be told when they need to update their CMake. "
! "Specifying a version also helps the project build with CMake versions "
! "newer than that specified. "
! "Use the cmake_minimum_required command at the top of your main "
! " CMakeLists.txt file:\n"
" cmake_minimum_required(VERSION <major>.<minor>)\n"
"where \"<major>.<minor>\" is the version of CMake you want to support "
"(such as \"2.6\"). "
"The command will ensure that at least the given version of CMake is "
! "running and help newer versions be compatible with the project. "
! "See documentation of cmake_minimum_required for details.",
2,6,0, cmPolicies::WARN
);
***************
*** 206,210 ****
" target_link_libraries(myexe /path/to/libA.so /path/to/libB.so)\n"
"When all items on the link line have known paths CMake does not check "
! "this policy so it has no effect.",
2,6,0, cmPolicies::WARN);
--- 202,209 ----
" target_link_libraries(myexe /path/to/libA.so /path/to/libB.so)\n"
"When all items on the link line have known paths CMake does not check "
! "this policy so it has no effect.\n"
! "Note that the warning for this policy will be issued for at most "
! "one target. This avoids flooding users with messages for every "
! "target when setting the policy once will probably fix all targets.",
2,6,0, cmPolicies::WARN);
***************
*** 303,306 ****
--- 302,309 ----
&majorVer, &minorVer, &patchVer) < 2)
{
+ cmOStringStream e;
+ e << "Invalid policy version value \"" << ver << "\". "
+ << "A numeric major.minor[.patch] must be given.";
+ mf->IssueMessage(cmake::FATAL_ERROR, e.str());
return false;
}
***************
*** 319,322 ****
--- 322,345 ----
"One way to so this is to set the policy version to 2.4 exactly."
);
+ return false;
+ }
+
+ // It is an error if the policy version is greater than the running
+ // CMake.
+ if (majorVer > cmVersion::GetMajorVersion() ||
+ (majorVer == cmVersion::GetMajorVersion() &&
+ minorVer > cmVersion::GetMinorVersion()) ||
+ (majorVer == cmVersion::GetMajorVersion() &&
+ minorVer == cmVersion::GetMinorVersion() &&
+ patchVer > cmVersion::GetPatchVersion()))
+ {
+ cmOStringStream e;
+ e << "An attempt was made to set the policy version of CMake to \""
+ << version << "\" which is greater than this version of CMake. "
+ << "This is not allowed because the greater version may have new "
+ << "policies not known to this CMake. "
+ << "You may need a newer CMake version to build this project.";
+ mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ return false;
}
***************
*** 549,578 ****
full << i->second->LongDescription;
full << "\nThis policy was introduced in CMake version ";
! full << i->second->GetVersionString() << ". ";
! full << "CMake version " << cmVersion::GetMajorVersion()
! << "." << cmVersion::GetMinorVersion() << " ";
! // add in some more text here based on status
! switch (i->second->Status)
! {
! case cmPolicies::WARN:
! full << "defaults to WARN for this policy. "
! << "Use the cmake_policy command to set it to OLD or NEW.";
! break;
! case cmPolicies::OLD:
! full << "defaults to the OLD behavior for this policy.";
! break;
! case cmPolicies::NEW:
! full << "defaults to the NEW behavior for this policy.";
! break;
! case cmPolicies::REQUIRED_IF_USED:
! full << "requires the policy to be set to NEW if you use it. "
! << "Use the cmake_policy command to set it to NEW.";
! break;
! case cmPolicies::REQUIRED_ALWAYS:
! full << "requires the policy to be set to NEW. "
! << "Use the cmake_policy command to set it to NEW.";
! break;
! }
!
cmDocumentationEntry e(i->second->IDString.c_str(),
i->second->ShortDescription.c_str(),
--- 572,605 ----
full << i->second->LongDescription;
full << "\nThis policy was introduced in CMake version ";
! full << i->second->GetVersionString() << ".";
! if(i->first != cmPolicies::CMP0000)
! {
! full << " "
! << "CMake version " << cmVersion::GetMajorVersion()
! << "." << cmVersion::GetMinorVersion() << " ";
! // add in some more text here based on status
! switch (i->second->Status)
! {
! case cmPolicies::WARN:
! full << "warns when the policy is not set and uses OLD behavior. "
! << "Use the cmake_policy command to set it to OLD or NEW "
! << "explicitly.";
! break;
! case cmPolicies::OLD:
! full << "defaults to the OLD behavior for this policy.";
! break;
! case cmPolicies::NEW:
! full << "defaults to the NEW behavior for this policy.";
! break;
! case cmPolicies::REQUIRED_IF_USED:
! full << "requires the policy to be set to NEW if you use it. "
! << "Use the cmake_policy command to set it to NEW.";
! break;
! case cmPolicies::REQUIRED_ALWAYS:
! full << "requires the policy to be set to NEW. "
! << "Use the cmake_policy command to set it to NEW.";
! break;
! }
! }
cmDocumentationEntry e(i->second->IDString.c_str(),
i->second->ShortDescription.c_str(),
Index: cmIfCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmIfCommand.cxx,v
retrieving revision 1.84
retrieving revision 1.84.2.1
diff -C 2 -d -r1.84 -r1.84.2.1
*** cmIfCommand.cxx 1 Mar 2008 02:33:33 -0000 1.84
--- cmIfCommand.cxx 24 Mar 2008 22:23:26 -0000 1.84.2.1
***************
*** 358,361 ****
--- 358,378 ----
reducible = 1;
}
+ // does a policy exist
+ if (*arg == "POLICY" && argP1 != newArgs.end())
+ {
+ cmPolicies::PolicyID pid;
+ if(makefile->GetPolicies()->GetPolicyID((argP1)->c_str(), pid))
+ {
+ *arg = "1";
+ }
+ else
+ {
+ *arg = "0";
+ }
+ newArgs.erase(argP1);
+ argP1 = arg;
+ IncrementArguments(newArgs,argP1,argP2);
+ reducible = 1;
+ }
// is a variable defined
if (*arg == "DEFINED" && argP1 != newArgs.end())
Index: cmIfCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmIfCommand.h,v
retrieving revision 1.46
retrieving revision 1.46.2.1
diff -C 2 -d -r1.46 -r1.46.2.1
*** cmIfCommand.h 10 Feb 2008 22:19:10 -0000 1.46
--- cmIfCommand.h 24 Mar 2008 22:23:26 -0000 1.46.2.1
***************
*** 140,143 ****
--- 140,146 ----
"True if the given name is a command, macro or function that can be "
"invoked.\n"
+ " if(POLICY policy-id)\n"
+ "True if the given name is an existing policy "
+ "(of the form CMP<NNNN>).\n"
" if(EXISTS file-name)\n"
" if(EXISTS directory-name)\n"
Index: cmake.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.h,v
retrieving revision 1.109
retrieving revision 1.109.2.1
diff -C 2 -d -r1.109 -r1.109.2.1
*** cmake.h 13 Mar 2008 17:48:57 -0000 1.109
--- cmake.h 24 Mar 2008 22:23:26 -0000 1.109.2.1
***************
*** 389,392 ****
--- 389,393 ----
std::string StartOutputDirectory;
bool SuppressDevWarnings;
+ bool DoSuppressDevWarnings;
std::set<cmStdString> WrittenFiles;
Index: cmGlobalUnixMakefileGenerator3.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalUnixMakefileGenerator3.cxx,v
retrieving revision 1.126
retrieving revision 1.126.2.1
diff -C 2 -d -r1.126 -r1.126.2.1
*** cmGlobalUnixMakefileGenerator3.cxx 12 Mar 2008 18:37:46 -0000 1.126
--- cmGlobalUnixMakefileGenerator3.cxx 24 Mar 2008 22:23:26 -0000 1.126.2.1
***************
*** 968,972 ****
}
lg->WriteMakeRule(ruleFileStream, "Help Target",
! "help:",
no_depends, commands, true);
ruleFileStream << "\n\n";
--- 968,972 ----
}
lg->WriteMakeRule(ruleFileStream, "Help Target",
! "help",
no_depends, commands, true);
ruleFileStream << "\n\n";
Index: cmCMakePolicyCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCMakePolicyCommand.cxx,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -C 2 -d -r1.2 -r1.2.2.1
*** cmCMakePolicyCommand.cxx 5 Mar 2008 23:21:09 -0000 1.2
--- cmCMakePolicyCommand.cxx 24 Mar 2008 22:23:26 -0000 1.2.2.1
***************
*** 118,129 ****
return false;
}
! if(!this->Makefile->SetPolicyVersion(args[1].c_str()))
! {
! cmOStringStream e;
! e << "VERSION given invalid value \"" << args[1] << "\". "
! << "A numeric major.minor[.patch] must be given.";
! this->SetError(e.str().c_str());
! return false;
! }
return true;
}
--- 118,122 ----
return false;
}
! this->Makefile->SetPolicyVersion(args[1].c_str());
return true;
}
Index: cmake.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.cxx,v
retrieving revision 1.375
retrieving revision 1.375.2.1
diff -C 2 -d -r1.375 -r1.375.2.1
*** cmake.cxx 13 Mar 2008 19:34:17 -0000 1.375
--- cmake.cxx 24 Mar 2008 22:23:26 -0000 1.375.2.1
***************
*** 142,145 ****
--- 142,146 ----
{
this->SuppressDevWarnings = false;
+ this->DoSuppressDevWarnings = false;
this->DebugOutput = false;
this->DebugTryCompile = false;
***************
*** 388,395 ****
{
this->SuppressDevWarnings = true;
}
else if(arg.find("-Wdev",0) == 0)
! {
this->SuppressDevWarnings = false;
}
else if(arg.find("-U",0) == 0)
--- 389,398 ----
{
this->SuppressDevWarnings = true;
+ this->DoSuppressDevWarnings = true;
}
else if(arg.find("-Wdev",0) == 0)
! {
this->SuppressDevWarnings = false;
+ this->DoSuppressDevWarnings = true;
}
else if(arg.find("-U",0) == 0)
***************
*** 1897,1917 ****
int cmake::Configure()
{
! if(this->SuppressDevWarnings)
! {
! this->CacheManager->
! AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "TRUE",
! "Suppress Warnings that are meant for"
! " the author of the CMakeLists.txt files.",
! cmCacheManager::INTERNAL);
! }
! else
{
! this->CacheManager->
! AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "FALSE",
! "Suppress Warnings that are meant for"
! " the author of the CMakeLists.txt files.",
! cmCacheManager::INTERNAL);
}
-
int ret = this->ActualConfigure();
const char* delCacheVars =
--- 1900,1922 ----
int cmake::Configure()
{
! if(this->DoSuppressDevWarnings)
{
! if(this->SuppressDevWarnings)
! {
! this->CacheManager->
! AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "TRUE",
! "Suppress Warnings that are meant for"
! " the author of the CMakeLists.txt files.",
! cmCacheManager::INTERNAL);
! }
! else
! {
! this->CacheManager->
! AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "FALSE",
! "Suppress Warnings that are meant for"
! " the author of the CMakeLists.txt files.",
! cmCacheManager::INTERNAL);
! }
}
int ret = this->ActualConfigure();
const char* delCacheVars =
***************
*** 4186,4190 ****
if(t == cmake::AUTHOR_WARNING)
{
! msg << "This warning may be suppressed using the -Wno-dev option.";
}
--- 4191,4196 ----
if(t == cmake::AUTHOR_WARNING)
{
! msg <<
! "This warning is for project developers. Use -Wno-dev to suppress it.";
}
Index: cmCoreTryCompile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCoreTryCompile.cxx,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -C 2 -d -r1.7 -r1.7.2.1
*** cmCoreTryCompile.cxx 7 Mar 2008 13:53:22 -0000 1.7
--- cmCoreTryCompile.cxx 24 Mar 2008 22:23:26 -0000 1.7.2.1
***************
*** 176,180 ****
->GetLanguageFromExtension(ext.c_str()));
const char* def = this->Makefile->GetDefinition("CMAKE_MODULE_PATH");
! fprintf(fout, "cmake_policy(VERSION %u.%u)\n",
cmVersion::GetMajorVersion(), cmVersion::GetMinorVersion());
if(def)
--- 176,180 ----
->GetLanguageFromExtension(ext.c_str()));
const char* def = this->Makefile->GetDefinition("CMAKE_MODULE_PATH");
! fprintf(fout, "cmake_minimum_required(VERSION %u.%u)\n",
cmVersion::GetMajorVersion(), cmVersion::GetMinorVersion());
if(def)
Index: cmLocalUnixMakefileGenerator3.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalUnixMakefileGenerator3.cxx,v
retrieving revision 1.240.2.1
retrieving revision 1.240.2.2
diff -C 2 -d -r1.240.2.1 -r1.240.2.2
*** cmLocalUnixMakefileGenerator3.cxx 18 Mar 2008 14:23:54 -0000 1.240.2.1
--- cmLocalUnixMakefileGenerator3.cxx 24 Mar 2008 22:23:26 -0000 1.240.2.2
***************
*** 639,644 ****
os << "\t" << replace.c_str() << "\n";
}
os << "\n";
-
// Add the output to the local help if requested.
if(in_help)
--- 639,647 ----
os << "\t" << replace.c_str() << "\n";
}
+ if(symbolic)
+ {
+ os << ".PHONY : " << tgt.c_str() << "\n";
+ }
os << "\n";
// Add the output to the local help if requested.
if(in_help)
***************
*** 739,754 ****
".SUFFIXES", no_depends, no_commands, false);
! // turn off RCS and SCCS automatic stuff from gmake
! makefileStream << "# Remove some rules from gmake that .SUFFIXES does not remove.\n"
! << "# This makes gmake faster as it does not try to run implicit rules\n"
! << "# on targets that never exist.\n"
! << "%: %,v\n"
! << "%: RCS/%,v\n"
! << "%: RCS/%\n"
! << "%: s.%\n"
! << "%: %.w\n"
! << "%.c: %.w %.ch\n"
! << "%: %.tex\n"
! << "%: SCCS/s.%\n\n";
// Add a fake suffix to keep HP happy. Must be max 32 chars for SGI make.
std::vector<std::string> depends;
--- 742,762 ----
".SUFFIXES", no_depends, no_commands, false);
! if(!this->NMake && !this->WatcomWMake && !this->BorlandMakeCurlyHack)
! {
! // turn off RCS and SCCS automatic stuff from gmake
! makefileStream
! << "# Remove some rules from gmake that .SUFFIXES does not remove.\n"
! << "# This makes gmake faster as it does not try to run implicit rules\n"
! << "# on targets that never exist.\n"
! << "SUFFIXES =\n"
! << "%: %,v\n"
! << "%: RCS/%,v\n"
! << "%: RCS/%\n"
! << "%: s.%\n"
! << "%: %.w\n"
! << "%.c: %.w %.ch\n"
! << "%: %.tex\n"
! << "%: SCCS/s.%\n\n";
! }
// Add a fake suffix to keep HP happy. Must be max 32 chars for SGI make.
std::vector<std::string> depends;
Index: cmComputeLinkInformation.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmComputeLinkInformation.cxx,v
retrieving revision 1.24.2.1
retrieving revision 1.24.2.2
diff -C 2 -d -r1.24.2.1 -r1.24.2.2
*** cmComputeLinkInformation.cxx 18 Mar 2008 14:23:54 -0000 1.24.2.1
--- cmComputeLinkInformation.cxx 24 Mar 2008 22:23:26 -0000 1.24.2.2
***************
*** 1178,1183 ****
else if(item[0] == '-' || item[0] == '$' || item[0] == '`')
{
! // This is a linker option provided by the user.
! this->OldUserFlagItems.push_back(item);
// Restore the target link type since this item does not specify
--- 1178,1186 ----
else if(item[0] == '-' || item[0] == '$' || item[0] == '`')
{
! if(item.find("-framework") != 0)
! {
! // This is a linker option provided by the user.
! this->OldUserFlagItems.push_back(item);
! }
// Restore the target link type since this item does not specify
***************
*** 1335,1346 ****
{
case cmPolicies::WARN:
! {
! cmOStringStream w;
! w << (this->Makefile->GetPolicies()
! ->GetPolicyWarning(cmPolicies::CMP0003)) << "\n";
! this->PrintLinkPolicyDiagnosis(w);
! this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(),
! this->Target->GetBacktrace());
! }
case cmPolicies::OLD:
// OLD behavior is to add the paths containing libraries with
--- 1338,1349 ----
{
case cmPolicies::WARN:
! if(!this->CMakeInstance->GetPropertyAsBool("CMP0003-WARNING-GIVEN"))
! {
! this->CMakeInstance->SetProperty("CMP0003-WARNING-GIVEN", "1");
! cmOStringStream w;
! this->PrintLinkPolicyDiagnosis(w);
! this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(),
! this->Target->GetBacktrace());
! }
case cmPolicies::OLD:
// OLD behavior is to add the paths containing libraries with
***************
*** 1376,1398 ****
void cmComputeLinkInformation::PrintLinkPolicyDiagnosis(std::ostream& os)
{
! // Name the target.
! os << "Target \"" << this->Target->GetName() << "\" ";
!
! // List the items that would add paths in old behavior.
! std::set<cmStdString> emitted;
! os << " links to some items by full path not located in any linker search "
! << "directory added by a link_directories command:\n";
! for(std::vector<std::string>::const_iterator
! i = this->OldLinkDirItems.begin();
! i != this->OldLinkDirItems.end(); ++i)
! {
! if(emitted.insert(cmSystemTools::GetFilenamePath(*i)).second)
! {
! os << " " << *i << "\n";
! }
! }
// List the items that might need the old-style paths.
! os << "This is okay but it also links to some items with no path known:\n";
{
// Format the list of unknown items to be as short as possible while
--- 1379,1395 ----
void cmComputeLinkInformation::PrintLinkPolicyDiagnosis(std::ostream& os)
{
! // Tell the user what to do.
! os << "Policy CMP0003 should be set before this line. "
! << "Add code such as\n"
! << " if(COMMAND cmake_policy)\n"
! << " cmake_policy(SET CMP0003 NEW)\n"
! << " endif(COMMAND cmake_policy)\n"
! << "as early as possible but after the most recent call to "
! << "cmake_minimum_required or cmake_policy(VERSION). ";
// List the items that might need the old-style paths.
! os << "This warning appears because target \""
! << this->Target->GetName() << "\" "
! << "links to some libraries for which the linker must search:\n";
{
// Format the list of unknown items to be as short as possible while
***************
*** 1417,1421 ****
line += sep;
line += *i;
-
// Convert to the other separator.
sep = ", ";
--- 1414,1417 ----
***************
*** 1427,1437 ****
}
! // Tell the user what is wrong.
! os << "The linker will search for libraries in the second list. "
! << "Finding them may depend on linker search paths earlier CMake "
! << "versions added as an implementation detail for linking to the "
! << "libraries in the first list. "
! << "For compatibility CMake is including the extra linker search "
! << "paths, but policy CMP0003 should be set by the project.";
}
--- 1423,1446 ----
}
! // List the paths old behavior is adding.
! os << "and other libraries with known full path:\n";
! std::set<cmStdString> emitted;
! for(std::vector<std::string>::const_iterator
! i = this->OldLinkDirItems.begin();
! i != this->OldLinkDirItems.end(); ++i)
! {
! if(emitted.insert(cmSystemTools::GetFilenamePath(*i)).second)
! {
! os << " " << *i << "\n";
! }
! }
!
! // Explain.
! os << "CMake is adding directories in the second list to the linker "
! << "search path in case they are needed to find libraries from the "
! << "first list (for backwards compatibility with CMake 2.4). "
! << "Set policy CMP0003 to OLD or NEW to enable or disable this "
! << "behavior explicitly. "
! << "Run \"cmake --help-policy CMP0003\" for more information.";
}
Index: cmCMakeMinimumRequired.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCMakeMinimumRequired.cxx,v
retrieving revision 1.17
retrieving revision 1.17.2.1
diff -C 2 -d -r1.17 -r1.17.2.1
*** cmCMakeMinimumRequired.cxx 7 Mar 2008 16:43:47 -0000 1.17
--- cmCMakeMinimumRequired.cxx 24 Mar 2008 22:23:26 -0000 1.17.2.1
***************
*** 100,110 ****
// The current version is too low.
cmOStringStream e;
! e << "This project requires version " << version_string.c_str()
! << " of CMake. "
! << "You are running version "
! << current_major << "." << current_minor << "." << current_patch
! << ".\n";
! cmSystemTools::Error(e.str().c_str());
cmSystemTools::SetFatalErrorOccured();
}
--- 100,109 ----
// The current version is too low.
cmOStringStream e;
! e << "CMake " << version_string.c_str()
! << " or higher is required. You are running version "
! << current_major << "." << current_minor << "." << current_patch;
! this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
cmSystemTools::SetFatalErrorOccured();
+ return true;
}
More information about the Cmake-commits
mailing list