|
|
@@ -10,6 +10,7 @@
|
|
|
See the License for more information.
|
|
|
============================================================================*/
|
|
|
#include "windows.h" // this must be first to define GetCurrentDirectory
|
|
|
+#include <assert.h>
|
|
|
#include "cmGlobalVisualStudio7Generator.h"
|
|
|
#include "cmGeneratedFileStream.h"
|
|
|
#include "cmLocalVisualStudio7Generator.h"
|
|
|
@@ -243,20 +244,23 @@ void cmGlobalVisualStudio7Generator::WriteTargetConfigurations(
|
|
|
const char* expath = target->GetProperty("EXTERNAL_MSPROJECT");
|
|
|
if(expath)
|
|
|
{
|
|
|
+ std::set<std::string> allConfigurations(this->Configurations.begin(),
|
|
|
+ this->Configurations.end());
|
|
|
this->WriteProjectConfigurations(
|
|
|
fout, target->GetName(),
|
|
|
- true, target->GetProperty("VS_PLATFORM_MAPPING"));
|
|
|
+ allConfigurations, target->GetProperty("VS_PLATFORM_MAPPING"));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- bool partOfDefaultBuild = this->IsPartOfDefaultBuild(
|
|
|
- root->GetMakefile()->GetProjectName(), target);
|
|
|
+ const std::set<std::string>& configsPartOfDefaultBuild =
|
|
|
+ this->IsPartOfDefaultBuild(root->GetMakefile()->GetProjectName(),
|
|
|
+ target);
|
|
|
const char *vcprojName =
|
|
|
target->GetProperty("GENERATOR_FILE_NAME");
|
|
|
if (vcprojName)
|
|
|
{
|
|
|
this->WriteProjectConfigurations(fout, vcprojName,
|
|
|
- partOfDefaultBuild);
|
|
|
+ configsPartOfDefaultBuild);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -582,9 +586,10 @@ cmGlobalVisualStudio7Generator
|
|
|
// Write a dsp file into the SLN file, Note, that dependencies from
|
|
|
// executables to the libraries it uses are also done here
|
|
|
void cmGlobalVisualStudio7Generator
|
|
|
-::WriteProjectConfigurations(std::ostream& fout, const char* name,
|
|
|
- bool partOfDefaultBuild,
|
|
|
- const char* platformMapping)
|
|
|
+::WriteProjectConfigurations(
|
|
|
+ std::ostream& fout, const char* name,
|
|
|
+ const std::set<std::string>& configsPartOfDefaultBuild,
|
|
|
+ const char* platformMapping)
|
|
|
{
|
|
|
std::string guid = this->GetGUID(name);
|
|
|
for(std::vector<std::string>::iterator i = this->Configurations.begin();
|
|
|
@@ -593,7 +598,9 @@ void cmGlobalVisualStudio7Generator
|
|
|
fout << "\t\t{" << guid << "}." << *i
|
|
|
<< ".ActiveCfg = " << *i << "|"
|
|
|
<< (platformMapping ? platformMapping : "Win32") << "\n";
|
|
|
- if(partOfDefaultBuild)
|
|
|
+ std::set<std::string>::const_iterator
|
|
|
+ ci = configsPartOfDefaultBuild.find(*i);
|
|
|
+ if(!(ci == configsPartOfDefaultBuild.end()))
|
|
|
{
|
|
|
fout << "\t\t{" << guid << "}." << *i
|
|
|
<< ".Build.0 = " << *i << "|"
|
|
|
@@ -825,26 +832,34 @@ cmGlobalVisualStudio7Generator
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-bool cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(const char* project,
|
|
|
- cmTarget* target)
|
|
|
+std::set<std::string>
|
|
|
+cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(const char* project,
|
|
|
+ cmTarget* target)
|
|
|
{
|
|
|
- if(target->GetPropertyAsBool("EXCLUDE_FROM_DEFAULT_BUILD"))
|
|
|
- {
|
|
|
- return false;
|
|
|
- }
|
|
|
+ std::set<std::string> activeConfigs;
|
|
|
// 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;
|
|
|
+ return activeConfigs;
|
|
|
+ }
|
|
|
+ if(type == cmTarget::UTILITY && !this->IsDependedOn(project, target))
|
|
|
+ {
|
|
|
+ return activeConfigs;
|
|
|
}
|
|
|
- if(type == cmTarget::UTILITY)
|
|
|
+ // inspect EXCLUDE_FROM_DEFAULT_BUILD[_<CONFIG>] properties
|
|
|
+ for(std::vector<std::string>::iterator i = this->Configurations.begin();
|
|
|
+ i != this->Configurations.end(); ++i)
|
|
|
{
|
|
|
- return this->IsDependedOn(project, target);
|
|
|
+ const char* propertyValue =
|
|
|
+ target->GetFeature("EXCLUDE_FROM_DEFAULT_BUILD", i->c_str());
|
|
|
+ if(cmSystemTools::IsOff(propertyValue))
|
|
|
+ {
|
|
|
+ activeConfigs.insert(*i);
|
|
|
+ }
|
|
|
}
|
|
|
- // default is to be part of the build
|
|
|
- return true;
|
|
|
+ return activeConfigs;
|
|
|
}
|
|
|
|
|
|
//----------------------------------------------------------------------------
|