[Cmake-commits] [cmake-commits] hoffman committed cmComputeLinkDepends.cxx 1.12.2.1 1.12.2.2 cmComputeLinkDepends.h 1.5.2.1 1.5.2.2 cmComputeLinkInformation.cxx 1.24.2.2 1.24.2.3 cmExportFileGenerator.cxx 1.11.2.1 1.11.2.2 cmListFileCache.cxx 1.41.2.1 1.41.2.2 cmLocalVisualStudio7Generator.cxx 1.217.2.1 1.217.2.2 cmMakefile.cxx 1.463.2.1 1.463.2.2 cmMakefile.h 1.230 1.230.2.1 cmPolicies.cxx 1.20.2.2 1.20.2.3
cmake-commits at cmake.org
cmake-commits at cmake.org
Mon Mar 31 17:57:43 EDT 2008
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv19806/Source
Modified Files:
Tag: CMake-2-6
cmComputeLinkDepends.cxx cmComputeLinkDepends.h
cmComputeLinkInformation.cxx cmExportFileGenerator.cxx
cmListFileCache.cxx cmLocalVisualStudio7Generator.cxx
cmMakefile.cxx cmMakefile.h cmPolicies.cxx
Log Message:
ENH: merge changes from head to 26 branch
Index: cmComputeLinkDepends.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmComputeLinkDepends.h,v
retrieving revision 1.5.2.1
retrieving revision 1.5.2.2
diff -C 2 -d -r1.5.2.1 -r1.5.2.2
*** cmComputeLinkDepends.h 18 Mar 2008 14:23:54 -0000 1.5.2.1
--- cmComputeLinkDepends.h 31 Mar 2008 21:57:41 -0000 1.5.2.2
***************
*** 55,58 ****
--- 55,62 ----
EntryVector const& Compute();
+ void SetOldLinkDirMode(bool b);
+ std::set<cmTarget*> const& GetOldWrongConfigItems() const
+ { return this->OldWrongConfigItems; }
+
private:
***************
*** 129,132 ****
--- 133,141 ----
void EmitComponent(NodeList const& nl);
void DisplayFinalEntries();
+
+ // Compatibility help.
+ bool OldLinkDirMode;
+ void CheckWrongConfigItem(std::string const& item);
+ std::set<cmTarget*> OldWrongConfigItems;
};
Index: cmLocalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.cxx,v
retrieving revision 1.217.2.1
retrieving revision 1.217.2.2
diff -C 2 -d -r1.217.2.1 -r1.217.2.2
*** cmLocalVisualStudio7Generator.cxx 30 Mar 2008 13:09:25 -0000 1.217.2.1
--- cmLocalVisualStudio7Generator.cxx 31 Mar 2008 21:57:41 -0000 1.217.2.2
***************
*** 32,35 ****
--- 32,37 ----
#include <ctype.h> // for isspace
+ static bool cmLVS6G_IsFAT(const char* dir);
+
class cmLocalVisualStudio7GeneratorInternals
{
***************
*** 662,675 ****
fout << "\t\t\t\tProxyFileName=\"$(InputName)_p.c\"/>\n";
// end of <Tool Name=VCMIDLTool
!
! // If we are building a version 8 project file, add a flag telling the
! // manifest tool to use a workaround for FAT32 file systems, which can cause
! // an empty manifest to be embedded into the resulting executable.
! // See CMake bug #2617.
if ( this->Version >= 8 )
{
! fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n"
! << "\t\t\t\tUseFAT32Workaround=\"true\"\n"
! << "\t\t\t/>\n";
}
--- 664,682 ----
fout << "\t\t\t\tProxyFileName=\"$(InputName)_p.c\"/>\n";
// end of <Tool Name=VCMIDLTool
!
! // Check if we need the FAT32 workaround.
if ( this->Version >= 8 )
{
! // Check the filesystem type where the target will be written.
! if(cmLVS6G_IsFAT(target.GetDirectory(configName)))
! {
! // Add a flag telling the manifest tool to use a workaround
! // for FAT32 file systems, which can cause an empty manifest
! // to be embedded into the resulting executable. See CMake
! // bug #2617.
! fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n"
! << "\t\t\t\tUseFAT32Workaround=\"true\"\n"
! << "\t\t\t/>\n";
! }
}
***************
*** 2055,2056 ****
--- 2062,2081 ----
dirs.push_back(dir);
}
+
+ //----------------------------------------------------------------------------
+ #include <windows.h>
+ static bool cmLVS6G_IsFAT(const char* dir)
+ {
+ if(dir[0] && dir[1] == ':')
+ {
+ char volRoot[4] = "_:/";
+ volRoot[0] = dir[0];
+ char fsName[16];
+ if(GetVolumeInformation(volRoot, 0, 0, 0, 0, 0, fsName, 16) &&
+ strstr(fsName, "FAT") != 0)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
Index: cmListFileCache.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmListFileCache.cxx,v
retrieving revision 1.41.2.1
retrieving revision 1.41.2.2
diff -C 2 -d -r1.41.2.1 -r1.41.2.2
*** cmListFileCache.cxx 24 Mar 2008 22:23:26 -0000 1.41.2.1
--- cmListFileCache.cxx 31 Mar 2008 21:57:41 -0000 1.41.2.2
***************
*** 172,199 ****
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;
! }
}
}
--- 172,181 ----
if (isProblem)
{
! // Tell the top level cmMakefile to diagnose
! // this violation of CMP0000.
! mf->SetCheckCMP0000(true);
!
! // Implicitly set the version for the user.
! mf->SetPolicyVersion("2.4");
}
}
Index: cmPolicies.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmPolicies.cxx,v
retrieving revision 1.20.2.2
retrieving revision 1.20.2.3
diff -C 2 -d -r1.20.2.2 -r1.20.2.3
*** cmPolicies.cxx 24 Mar 2008 22:23:26 -0000 1.20.2.2
--- cmPolicies.cxx 31 Mar 2008 21:57:41 -0000 1.20.2.3
***************
*** 102,106 ****
"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
);
--- 102,114 ----
"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.\n"
! "Note that the command invocation must appear in the CMakeLists.txt "
! "file itself; a call in an included file is not sufficient. "
! "However, the cmake_policy command may be called to set policy "
! "CMP0000 to OLD or NEW behavior explicitly. "
! "The OLD behavior is to silently ignore the missing invocation. "
! "The NEW behavior is to issue an error instead of a warning. "
! "An included file may set CMP0000 explicitly to affect how this "
! "policy is enforced for the main CMakeLists.txt file.",
2,6,0, cmPolicies::WARN
);
Index: cmExportFileGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmExportFileGenerator.cxx,v
retrieving revision 1.11.2.1
retrieving revision 1.11.2.2
diff -C 2 -d -r1.11.2.1 -r1.11.2.2
*** cmExportFileGenerator.cxx 18 Mar 2008 14:23:54 -0000 1.11.2.1
--- cmExportFileGenerator.cxx 31 Mar 2008 21:57:41 -0000 1.11.2.2
***************
*** 80,89 ****
std::ostream& os = *foutPtr;
! // Start with the import file header.
os << "CMAKE_POLICY(PUSH)\n"
! << "CMAKE_POLICY(VERSION "
! << cmVersion::GetMajorVersion() << "."
! << cmVersion::GetMinorVersion() << "."
! << cmVersion::GetPatchVersion() << ")\n";
this->GenerateImportHeaderCode(os);
--- 80,91 ----
std::ostream& os = *foutPtr;
! // Isolate the file policy level.
! // We use 2.6 here instead of the current version because newer
! // versions of CMake should be able to export files imported by 2.6
! // until the import format changes.
os << "CMAKE_POLICY(PUSH)\n"
! << "CMAKE_POLICY(VERSION 2.6)\n";
!
! // Start with the import file header.
this->GenerateImportHeaderCode(os);
Index: cmComputeLinkInformation.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmComputeLinkInformation.cxx,v
retrieving revision 1.24.2.2
retrieving revision 1.24.2.3
diff -C 2 -d -r1.24.2.2 -r1.24.2.3
*** cmComputeLinkInformation.cxx 24 Mar 2008 22:23:26 -0000 1.24.2.2
--- cmComputeLinkInformation.cxx 31 Mar 2008 21:57:41 -0000 1.24.2.3
***************
*** 511,514 ****
--- 511,515 ----
// Compute the ordered link line items.
cmComputeLinkDepends cld(this->Target, this->Config);
+ cld.SetOldLinkDirMode(this->OldLinkDirMode);
cmComputeLinkDepends::EntryVector const& linkEntries = cld.Compute();
***************
*** 540,543 ****
--- 541,563 ----
}
+ // Finish listing compatibility paths.
+ if(this->OldLinkDirMode)
+ {
+ // For CMake 2.4 bug-compatibility we need to consider the output
+ // directories of targets linked in another configuration as link
+ // directories.
+ std::set<cmTarget*> const& wrongItems = cld.GetOldWrongConfigItems();
+ for(std::set<cmTarget*>::const_iterator i = wrongItems.begin();
+ i != wrongItems.end(); ++i)
+ {
+ cmTarget* tgt = *i;
+ bool implib =
+ (this->UseImportLibrary &&
+ (tgt->GetType() == cmTarget::SHARED_LIBRARY));
+ std::string lib = tgt->GetFullPath(this->Config , implib, true);
+ this->OldLinkDirItems.push_back(lib);
+ }
+ }
+
// Finish setting up linker search directories.
if(!this->FinishLinkerSearchDirectories())
Index: cmComputeLinkDepends.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmComputeLinkDepends.cxx,v
retrieving revision 1.12.2.1
retrieving revision 1.12.2.2
diff -C 2 -d -r1.12.2.1 -r1.12.2.2
*** cmComputeLinkDepends.cxx 18 Mar 2008 14:23:54 -0000 1.12.2.1
--- cmComputeLinkDepends.cxx 31 Mar 2008 21:57:41 -0000 1.12.2.2
***************
*** 170,173 ****
--- 170,176 ----
// Enable debug mode if requested.
this->DebugMode = this->Makefile->IsOn("CMAKE_LINK_DEPENDS_DEBUG_MODE");
+
+ // Assume no compatibility until set.
+ this->OldLinkDirMode = false;
}
***************
*** 184,187 ****
--- 187,196 ----
//----------------------------------------------------------------------------
+ void cmComputeLinkDepends::SetOldLinkDirMode(bool b)
+ {
+ this->OldLinkDirMode = b;
+ }
+
+ //----------------------------------------------------------------------------
std::vector<cmComputeLinkDepends::LinkEntry> const&
cmComputeLinkDepends::Compute()
***************
*** 461,464 ****
--- 470,477 ----
actual_libs.push_back(*di);
}
+ else if(this->OldLinkDirMode)
+ {
+ this->CheckWrongConfigItem(*di);
+ }
// Reset the link type until another explicit type is given.
***************
*** 493,496 ****
--- 506,513 ----
actual_libs.push_back(li->first);
}
+ else if(this->OldLinkDirMode)
+ {
+ this->CheckWrongConfigItem(li->first);
+ }
}
***************
*** 810,811 ****
--- 827,848 ----
fprintf(stderr, "\n");
}
+
+ //----------------------------------------------------------------------------
+ void cmComputeLinkDepends::CheckWrongConfigItem(std::string const& item)
+ {
+ if(!this->OldLinkDirMode)
+ {
+ return;
+ }
+
+ // For CMake 2.4 bug-compatibility we need to consider the output
+ // directories of targets linked in another configuration as link
+ // directories.
+ if(cmTarget* tgt = this->Makefile->FindTargetToUse(item.c_str()))
+ {
+ if(!tgt->IsImported())
+ {
+ this->OldWrongConfigItems.insert(tgt);
+ }
+ }
+ }
Index: cmMakefile.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.h,v
retrieving revision 1.230
retrieving revision 1.230.2.1
diff -C 2 -d -r1.230 -r1.230.2.1
*** cmMakefile.h 13 Mar 2008 17:48:57 -0000 1.230
--- cmMakefile.h 31 Mar 2008 21:57:41 -0000 1.230.2.1
***************
*** 794,797 ****
--- 794,800 ----
std::string const& text) const;
+ /** Set whether or not to report a CMP0000 violation. */
+ void SetCheckCMP0000(bool b) { this->CheckCMP0000 = b; }
+
protected:
// add link libraries and directories to the target
***************
*** 905,908 ****
--- 908,916 ----
cmPolicies::PolicyStatus> PolicyMap;
std::vector<PolicyMap> PolicyStack;
+
+ bool CheckCMP0000;
+
+ // Enforce rules about CMakeLists.txt files.
+ void EnforceDirectoryLevelRules(bool endScopeNicely);
};
Index: cmMakefile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.cxx,v
retrieving revision 1.463.2.1
retrieving revision 1.463.2.2
diff -C 2 -d -r1.463.2.1 -r1.463.2.2
*** cmMakefile.cxx 18 Mar 2008 14:23:54 -0000 1.463.2.1
--- cmMakefile.cxx 31 Mar 2008 21:57:41 -0000 1.463.2.2
***************
*** 147,150 ****
--- 147,154 ----
// Enter a policy level for this directory.
this->PushPolicy();
+
+ // By default the check is not done. It is enabled by
+ // cmListFileCache in the top level if necessary.
+ this->CheckCMP0000 = false;
}
***************
*** 562,578 ****
}
! // If this is the directory-level CMakeLists.txt file then enforce
! // policy stack depth.
if(this->ListFileStack.size() == 1)
{
! while(this->PolicyStack.size() > 1)
! {
! if(endScopeNicely)
! {
! this->IssueMessage(cmake::FATAL_ERROR,
! "cmake_policy PUSH without matching POP");
! }
! this->PopPolicy(false);
! }
}
--- 566,574 ----
}
! // If this is the directory-level CMakeLists.txt file then perform
! // some extra checks.
if(this->ListFileStack.size() == 1)
{
! this->EnforceDirectoryLevelRules(endScopeNicely);
}
***************
*** 586,589 ****
--- 582,634 ----
}
+ //----------------------------------------------------------------------------
+ void cmMakefile::EnforceDirectoryLevelRules(bool endScopeNicely)
+ {
+ // Enforce policy stack depth.
+ while(this->PolicyStack.size() > 1)
+ {
+ if(endScopeNicely)
+ {
+ this->IssueMessage(cmake::FATAL_ERROR,
+ "cmake_policy PUSH without matching POP");
+ }
+ this->PopPolicy(false);
+ }
+
+ // Diagnose a violation of CMP0000 if necessary.
+ if(this->CheckCMP0000)
+ {
+ 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 (this->GetPolicyStatus(cmPolicies::CMP0000))
+ {
+ case cmPolicies::WARN:
+ // Warn because the user did not provide a mimimum required
+ // version.
+ this->IssueMessage(cmake::AUTHOR_WARNING, msg.str().c_str());
+ case cmPolicies::OLD:
+ // OLD behavior is to use policy version 2.4 set in
+ // cmListFileCache.
+ break;
+ case cmPolicies::REQUIRED_IF_USED:
+ case cmPolicies::REQUIRED_ALWAYS:
+ case cmPolicies::NEW:
+ // NEW behavior is to issue an error.
+ this->IssueMessage(cmake::FATAL_ERROR, msg.str().c_str());
+ cmSystemTools::SetFatalErrorOccured();
+ return;
+ }
+ }
+ }
void cmMakefile::AddCommand(cmCommand* wg)
More information about the Cmake-commits
mailing list