[cmake-commits] hoffman committed cmGlobalGenerator.cxx 1.137.2.8
1.137.2.9 cmGlobalGenerator.h 1.58.2.4 1.58.2.5
cmGlobalVisualStudio71Generator.cxx 1.30.2.3 1.30.2.4
cmGlobalVisualStudio71Generator.h 1.12.2.3 1.12.2.4
cmGlobalVisualStudio7Generator.cxx 1.70.2.5 1.70.2.6
cmGlobalVisualStudio7Generator.h 1.34.2.4 1.34.2.5
cmGlobalVisualStudio8Generator.cxx 1.10.2.3 1.10.2.4
cmGlobalVisualStudio8Generator.h 1.4.2.3 1.4.2.4
cmSetTargetPropertiesCommand.h 1.21.2.5 1.21.2.6 cmake.cxx
1.247.2.8 1.247.2.9 cmake.h 1.65.2.4 1.65.2.5
cmake-commits at cmake.org
cmake-commits at cmake.org
Fri Nov 10 10:12:57 EST 2006
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv30791/Source
Modified Files:
Tag: CMake-2-4
cmGlobalGenerator.cxx cmGlobalGenerator.h
cmGlobalVisualStudio71Generator.cxx
cmGlobalVisualStudio71Generator.h
cmGlobalVisualStudio7Generator.cxx
cmGlobalVisualStudio7Generator.h
cmGlobalVisualStudio8Generator.cxx
cmGlobalVisualStudio8Generator.h
cmSetTargetPropertiesCommand.h cmake.cxx cmake.h
Log Message:
ENH: merge from main tree fix for vs all build qt and mpi2
Index: cmGlobalVisualStudio8Generator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio8Generator.h,v
retrieving revision 1.4.2.3
retrieving revision 1.4.2.4
diff -u -d -r1.4.2.3 -r1.4.2.4
--- cmGlobalVisualStudio8Generator.h 13 Oct 2006 14:52:02 -0000 1.4.2.3
+++ cmGlobalVisualStudio8Generator.h 10 Nov 2006 15:12:55 -0000 1.4.2.4
@@ -57,7 +57,7 @@
virtual void WriteSolutionConfigurations(std::ostream& fout);
virtual void WriteProjectConfigurations(std::ostream& fout,
const char* name,
- int targetType);
+ bool partOfDefaultBuild);
std::string PlatformName; // Win32 or x64
};
#endif
Index: cmGlobalVisualStudio8Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio8Generator.cxx,v
retrieving revision 1.10.2.3
retrieving revision 1.10.2.4
diff -u -d -r1.10.2.3 -r1.10.2.4
--- cmGlobalVisualStudio8Generator.cxx 13 Oct 2006 14:52:02 -0000 1.10.2.3
+++ cmGlobalVisualStudio8Generator.cxx 10 Nov 2006 15:12:55 -0000 1.10.2.4
@@ -228,7 +228,7 @@
void
cmGlobalVisualStudio8Generator
::WriteProjectConfigurations(std::ostream& fout, const char* name,
- int targetType)
+ bool partOfDefaultBuild)
{
std::string guid = this->GetGUID(name);
for(std::vector<std::string>::iterator i = this->Configurations.begin();
@@ -237,7 +237,7 @@
fout << "\t\t{" << guid << "}." << *i
<< "|" << this->PlatformName << ".ActiveCfg = "
<< *i << "|" << this->PlatformName << "\n";
- if(targetType != cmTarget::GLOBAL_TARGET)
+ if(partOfDefaultBuild)
{
fout << "\t\t{" << guid << "}." << *i
<< "|" << this->PlatformName << ".Build.0 = "
Index: cmake.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.h,v
retrieving revision 1.65.2.4
retrieving revision 1.65.2.5
diff -u -d -r1.65.2.4 -r1.65.2.5
--- cmake.h 13 Oct 2006 14:52:06 -0000 1.65.2.4
+++ cmake.h 10 Nov 2006 15:12:55 -0000 1.65.2.5
@@ -284,6 +284,7 @@
// Do we want debug output during the cmake run.
bool GetDebugOutput() { return this->DebugOutput; }
void DebugOutputOn() { this->DebugOutput = true;}
+
protected:
typedef cmGlobalGenerator* (*CreateGeneratorFunctionType)();
typedef std::map<cmStdString,
Index: cmGlobalGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalGenerator.h,v
retrieving revision 1.58.2.4
retrieving revision 1.58.2.5
diff -u -d -r1.58.2.4 -r1.58.2.5
--- cmGlobalGenerator.h 13 Oct 2006 14:52:02 -0000 1.58.2.4
+++ cmGlobalGenerator.h 10 Nov 2006 15:12:55 -0000 1.58.2.5
@@ -168,6 +168,9 @@
///! Find a target by name by searching the local generators.
cmTarget* FindTarget(const char* project, const char* name);
+ /** If check to see if the target is linked to by any other
+ target in the project */
+ bool IsDependedOn(const char* project, cmTarget* target);
///! Find a local generator by its startdirectory
cmLocalGenerator* FindLocalGenerator(const char* start_dir);
Index: cmGlobalVisualStudio71Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio71Generator.cxx,v
retrieving revision 1.30.2.3
retrieving revision 1.30.2.4
diff -u -d -r1.30.2.3 -r1.30.2.4
--- cmGlobalVisualStudio71Generator.cxx 13 Oct 2006 14:52:02 -0000 1.30.2.3
+++ cmGlobalVisualStudio71Generator.cxx 10 Nov 2006 15:12:55 -0000 1.30.2.4
@@ -254,13 +254,16 @@
const cmCustomCommandLines& cmds = cc.GetCommandLines();
std::string project = cmds[0][0];
this->WriteProjectConfigurations(fout, project.c_str(),
- l->second.GetType());
+ true);
}
else if ((l->second.GetType() != cmTarget::INSTALL_FILES)
&& (l->second.GetType() != cmTarget::INSTALL_PROGRAMS))
{
+ bool partOfDefaultBuild = this->IsPartOfDefaultBuild(
+ root->GetMakefile()->GetProjectName(),
+ &l->second);
this->WriteProjectConfigurations(fout, si->c_str(),
- l->second.GetType());
+ partOfDefaultBuild);
++si;
}
}
@@ -415,7 +418,7 @@
// executables to the libraries it uses are also done here
void cmGlobalVisualStudio71Generator
::WriteProjectConfigurations(std::ostream& fout, const char* name,
- int targetType)
+ bool partOfDefaultBuild)
{
std::string guid = this->GetGUID(name);
for(std::vector<std::string>::iterator i = this->Configurations.begin();
@@ -423,7 +426,7 @@
{
fout << "\t\t{" << guid << "}." << *i
<< ".ActiveCfg = " << *i << "|Win32\n";
- if(targetType != cmTarget::GLOBAL_TARGET)
+ if(partOfDefaultBuild)
{
fout << "\t\t{" << guid << "}." << *i
<< ".Build.0 = " << *i << "|Win32\n";
Index: cmake.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.cxx,v
retrieving revision 1.247.2.8
retrieving revision 1.247.2.9
diff -u -d -r1.247.2.8 -r1.247.2.9
--- cmake.cxx 27 Oct 2006 20:01:48 -0000 1.247.2.8
+++ cmake.cxx 10 Nov 2006 15:12:55 -0000 1.247.2.9
@@ -1307,6 +1307,7 @@
return 1;
}
+//----------------------------------------------------------------------------
void cmake::GetRegisteredGenerators(std::vector<std::string>& names)
{
for(RegisteredGeneratorsMap::const_iterator i = this->Generators.begin();
Index: cmGlobalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalGenerator.cxx,v
retrieving revision 1.137.2.8
retrieving revision 1.137.2.9
diff -u -d -r1.137.2.8 -r1.137.2.9
--- cmGlobalGenerator.cxx 27 Oct 2006 20:01:47 -0000 1.137.2.8
+++ cmGlobalGenerator.cxx 10 Nov 2006 15:12:55 -0000 1.137.2.9
@@ -591,6 +591,30 @@
this->LanguageEnabled.clear();
}
+bool cmGlobalGenerator::IsDependedOn(const char* project,
+ cmTarget* targetIn)
+{
+ // Get all local gens for this project
+ std::vector<cmLocalGenerator*>* gens = &this->ProjectMap[project];
+ // loop over local gens and get the targets for each one
+ for(unsigned int i = 0; i < gens->size(); ++i)
+ {
+ cmTargets& targets = (*gens)[i]->GetMakefile()->GetTargets();
+ for (cmTargets::iterator l = targets.begin();
+ l != targets.end(); l++)
+ {
+ cmTarget& target = l->second;
+ std::set<cmStdString>::const_iterator i =
+ target.GetUtilities().find(targetIn->GetName());
+ if(i != target.GetUtilities().end())
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
void cmGlobalGenerator::Configure()
{
// Delete any existing cmLocalGenerators
@@ -1395,12 +1419,16 @@
singleLine.erase(singleLine.begin(), singleLine.end());
depends.erase(depends.begin(), depends.end());
singleLine.push_back(this->GetCMakeInstance()->GetCTestCommand());
+ singleLine.push_back("--force-new-ctest-process");
if(cmakeCfgIntDir && *cmakeCfgIntDir && cmakeCfgIntDir[0] != '.')
{
singleLine.push_back("-C");
singleLine.push_back(mf->GetDefinition("CMAKE_CFG_INTDIR"));
}
- singleLine.push_back("--force-new-ctest-process");
+ else // TODO: This is a hack. Should be something to do with the generator
+ {
+ singleLine.push_back("$(ARGS)");
+ }
cpackCommandLines.push_back(singleLine);
(*targets)[this->GetTestTargetName()]
= this->CreateGlobalTarget(this->GetTestTargetName(),
@@ -1464,6 +1492,35 @@
//Install
if(this->InstallTargetEnabled)
{
+ if(!cmakeCfgIntDir || !*cmakeCfgIntDir || cmakeCfgIntDir[0] == '.')
+ {
+ std::set<cmStdString>* componentsSet = &this->InstallComponents;
+ cpackCommandLines.erase(cpackCommandLines.begin(),
+ cpackCommandLines.end());
+ depends.erase(depends.begin(), depends.end());
+ cmOStringStream ostr;
+ if ( componentsSet->size() > 0 )
+ {
+ ostr << "Available install components are:";
+ std::set<cmStdString>::iterator it;
+ for (
+ it = componentsSet->begin();
+ it != componentsSet->end();
+ ++ it )
+ {
+ ostr << " \"" << it->c_str() << "\"";
+ }
+ }
+ else
+ {
+ ostr << "Only default component available";
+ }
+ singleLine.push_back(ostr.str().c_str());
+ (*targets)["list_install_components"]
+ = this->CreateGlobalTarget("list_install_components",
+ ostr.str().c_str(),
+ &cpackCommandLines, depends);
+ }
std::string cmd;
cpackCommandLines.erase(cpackCommandLines.begin(),
cpackCommandLines.end());
Index: cmGlobalVisualStudio7Generator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio7Generator.h,v
retrieving revision 1.34.2.4
retrieving revision 1.34.2.5
diff -u -d -r1.34.2.4 -r1.34.2.5
--- cmGlobalVisualStudio7Generator.h 13 Oct 2006 14:52:02 -0000 1.34.2.4
+++ cmGlobalVisualStudio7Generator.h 10 Nov 2006 15:12:55 -0000 1.34.2.5
@@ -107,7 +107,7 @@
const char* name, const char* path, cmTarget &t);
virtual void WriteProjectConfigurations(std::ostream& fout,
const char* name,
- int targetType);
+ bool partOfDefaultBuild);
virtual void WriteSLNFooter(std::ostream& fout);
virtual void WriteSLNHeader(std::ostream& fout);
virtual void AddPlatformDefinitions(cmMakefile* mf);
@@ -120,6 +120,8 @@
std::string ConvertToSolutionPath(const char* path);
+ bool IsPartOfDefaultBuild(const char* project,
+ cmTarget* target);
std::vector<std::string> Configurations;
std::map<cmStdString, cmStdString> GUIDMap;
Index: cmGlobalVisualStudio71Generator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio71Generator.h,v
retrieving revision 1.12.2.3
retrieving revision 1.12.2.4
diff -u -d -r1.12.2.3 -r1.12.2.4
--- cmGlobalVisualStudio71Generator.h 13 Oct 2006 14:52:02 -0000 1.12.2.3
+++ cmGlobalVisualStudio71Generator.h 10 Nov 2006 15:12:55 -0000 1.12.2.4
@@ -55,7 +55,7 @@
const char* name, const char* path, cmTarget &t);
virtual void WriteProjectConfigurations(std::ostream& fout,
const char* name,
- int targetType);
+ bool partOfDefaultBuild);
virtual void WriteExternalProject(std::ostream& fout, const char* name,
const char* path,
const std::vector<std::string>& depends);
Index: cmGlobalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio7Generator.cxx,v
retrieving revision 1.70.2.5
retrieving revision 1.70.2.6
diff -u -d -r1.70.2.5 -r1.70.2.6
--- cmGlobalVisualStudio7Generator.cxx 13 Oct 2006 14:52:02 -0000 1.70.2.5
+++ cmGlobalVisualStudio7Generator.cxx 10 Nov 2006 15:12:55 -0000 1.70.2.6
@@ -537,13 +537,16 @@
const cmCustomCommandLines& cmds = cc.GetCommandLines();
std::string name = cmds[0][0];
this->WriteProjectConfigurations(fout, name.c_str(),
- l->second.GetType());
+ true);
}
else if ((l->second.GetType() != cmTarget::INSTALL_FILES)
&& (l->second.GetType() != cmTarget::INSTALL_PROGRAMS))
{
+ bool partOfDefaultBuild = this->IsPartOfDefaultBuild(
+ root->GetMakefile()->GetProjectName(),
+ &l->second);
this->WriteProjectConfigurations(fout, si->c_str(),
- l->second.GetType());
+ partOfDefaultBuild);
++si;
}
}
@@ -667,7 +670,7 @@
// executables to the libraries it uses are also done here
void cmGlobalVisualStudio7Generator
::WriteProjectConfigurations(std::ostream& fout, const char* name,
- int targetType)
+ bool partOfDefaultBuild)
{
std::string guid = this->GetGUID(name);
for(std::vector<std::string>::iterator i = this->Configurations.begin();
@@ -675,7 +678,7 @@
{
fout << "\t\t{" << guid << "}." << *i
<< ".ActiveCfg = " << *i << "|Win32\n";
- if(targetType != cmTarget::GLOBAL_TARGET)
+ if(partOfDefaultBuild)
{
fout << "\t\t{" << guid << "}." << *i
<< ".Build.0 = " << *i << "|Win32\n";
@@ -799,3 +802,25 @@
dir += suffix;
}
}
+
+bool cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(const char* project,
+ cmTarget* target)
+{
+ if(target->GetPropertyAsBool("EXCLUDE_FROM_DEFAULT_BUILD"))
+ {
+ return false;
+ }
+ // if it is a utilitiy target then only make it part of the
+ // default build if another target depends on it
+ int type = target->GetType();
+ if (type == cmTarget::GLOBAL_TARGET)
+ {
+ return false;
+ }
+ if(type == cmTarget::UTILITY)
+ {
+ return this->IsDependedOn(project, target);
+ }
+ // default is to be part of the build
+ return true;
+}
Index: cmSetTargetPropertiesCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSetTargetPropertiesCommand.h,v
retrieving revision 1.21.2.5
retrieving revision 1.21.2.6
diff -u -d -r1.21.2.5 -r1.21.2.6
--- cmSetTargetPropertiesCommand.h 27 Oct 2006 20:01:48 -0000 1.21.2.5
+++ cmSetTargetPropertiesCommand.h 10 Nov 2006 15:12:55 -0000 1.21.2.6
@@ -149,6 +149,10 @@
"installing a target. They are used only when the old "
"INSTALL_TARGETS command is used to install the target. Use the "
"INSTALL command instead."
+ "\n"
+ "The EXCLUDE_FROM_DEFAULT_BUILD property is used by the visual "
+ "studio generators. If it is set to 1 the target will not be "
+ "part of the default build when you select \"Build Solution\"."
;
}
More information about the Cmake-commits
mailing list