[Cmake-commits] CMake branch, next, updated. v2.8.2-721-g1865e7c
Brad King
brad.king at kitware.com
Wed Sep 8 15:20:12 EDT 2010
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 1865e7c8666189ff5bcabff7e97c946ede2fbbf0 (commit)
via b06fb1668424514bf45794d40bfc9f88dd5d619c (commit)
from f45b9c9ece3a5cc31ad64b31b3f6a4caeded4f1e (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=1865e7c8666189ff5bcabff7e97c946ede2fbbf0
commit 1865e7c8666189ff5bcabff7e97c946ede2fbbf0
Merge: f45b9c9 b06fb16
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Sep 8 15:20:11 2010 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Sep 8 15:20:11 2010 -0400
Merge topic 'multi-v-single-configuration' into next
b06fb16 No CMAKE_CONFIGURATION_TYPES in single-config generators (#10202)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b06fb1668424514bf45794d40bfc9f88dd5d619c
commit b06fb1668424514bf45794d40bfc9f88dd5d619c
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Sep 8 14:54:49 2010 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Wed Sep 8 14:54:49 2010 -0400
No CMAKE_CONFIGURATION_TYPES in single-config generators (#10202)
Factor out reading of CMAKE_CONFIGURATION_TYPES and CMAKE_BUILD_TYPE
into cmMakefile::GetConfigurations. Read the former only in
multi-config generators.
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx
index 48c5c6e..cb614d4 100644
--- a/Source/cmExportCommand.cxx
+++ b/Source/cmExportCommand.cxx
@@ -152,11 +152,10 @@ bool cmExportCommand
ebfg.SetCommand(this);
// Compute the set of configurations exported.
- if(const char* types =
- this->Makefile->GetDefinition("CMAKE_CONFIGURATION_TYPES"))
+ std::vector<std::string> configurationTypes;
+ this->Makefile->GetConfigurations(configurationTypes);
+ if(!configurationTypes.empty())
{
- std::vector<std::string> configurationTypes;
- cmSystemTools::ExpandListArgument(types, configurationTypes);
for(std::vector<std::string>::const_iterator
ci = configurationTypes.begin();
ci != configurationTypes.end(); ++ci)
@@ -164,11 +163,6 @@ bool cmExportCommand
ebfg.AddConfiguration(ci->c_str());
}
}
- else if(const char* config =
- this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"))
- {
- ebfg.AddConfiguration(config);
- }
else
{
ebfg.AddConfiguration("");
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 537a88f..c63b403 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -722,26 +722,10 @@ void cmGlobalXCodeGenerator::SetCurrentLocalGenerator(cmLocalGenerator* gen)
// Select the current set of configuration types.
this->CurrentConfigurationTypes.clear();
- if(this->XcodeVersion > 20)
- {
- if(const char* types =
- this->CurrentMakefile->GetDefinition("CMAKE_CONFIGURATION_TYPES"))
- {
- cmSystemTools::ExpandListArgument(types,
- this->CurrentConfigurationTypes);
- }
- }
+ this->CurrentMakefile->GetConfigurations(this->CurrentConfigurationTypes);
if(this->CurrentConfigurationTypes.empty())
{
- if(const char* buildType =
- this->CurrentMakefile->GetDefinition("CMAKE_BUILD_TYPE"))
- {
- this->CurrentConfigurationTypes.push_back(buildType);
- }
- else
- {
- this->CurrentConfigurationTypes.push_back("");
- }
+ this->CurrentConfigurationTypes.push_back("");
}
}
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index bac0223..5bffd52 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -278,16 +278,8 @@ void cmLocalGenerator::GenerateTestFiles()
// Compute the set of configurations.
std::vector<std::string> configurationTypes;
- if(const char* types =
- this->Makefile->GetDefinition("CMAKE_CONFIGURATION_TYPES"))
- {
- cmSystemTools::ExpandListArgument(types, configurationTypes);
- }
- const char* config = 0;
- if(configurationTypes.empty())
- {
- config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
- }
+ const char* config =
+ this->Makefile->GetConfigurations(configurationTypes, false);
std::string file = this->Makefile->GetStartOutputDirectory();
file += "/";
@@ -383,16 +375,8 @@ void cmLocalGenerator::GenerateInstallRules()
// Compute the set of configurations.
std::vector<std::string> configurationTypes;
- if(const char* types =
- this->Makefile->GetDefinition("CMAKE_CONFIGURATION_TYPES"))
- {
- cmSystemTools::ExpandListArgument(types, configurationTypes);
- }
- const char* config = 0;
- if(configurationTypes.empty())
- {
- config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
- }
+ const char* config =
+ this->Makefile->GetConfigurations(configurationTypes, false);
// Choose a default install configuration.
const char* default_config = config;
@@ -546,19 +530,7 @@ void cmLocalGenerator::GenerateTargetManifest()
{
// Collect the set of configuration types.
std::vector<std::string> configNames;
- if(const char* configurationTypes =
- this->Makefile->GetDefinition("CMAKE_CONFIGURATION_TYPES"))
- {
- cmSystemTools::ExpandListArgument(configurationTypes, configNames);
- }
- else if(const char* buildType =
- this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"))
- {
- if(*buildType)
- {
- configNames.push_back(buildType);
- }
- }
+ this->Makefile->GetConfigurations(configNames);
// Add our targets to the manifest for each configuration.
cmTargets& targets = this->Makefile->GetTargets();
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 8eece6b..c64053a 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1436,16 +1436,7 @@ void cmMakefile::InitializeFromParent()
this->SetProperty("COMPILE_DEFINITIONS",
parent->GetProperty("COMPILE_DEFINITIONS"));
std::vector<std::string> configs;
- if(const char* configTypes =
- this->GetDefinition("CMAKE_CONFIGURATION_TYPES"))
- {
- cmSystemTools::ExpandListArgument(configTypes, configs);
- }
- else if(const char* buildType =
- this->GetDefinition("CMAKE_BUILD_TYPE"))
- {
- configs.push_back(buildType);
- }
+ this->GetConfigurations(configs);
for(std::vector<std::string>::const_iterator ci = configs.begin();
ci != configs.end(); ++ci)
{
@@ -2367,6 +2358,31 @@ void cmMakefile::AddDefaultDefinitions()
cmake::GetCMakeFilesDirectory());
}
+//----------------------------------------------------------------------------
+const char*
+cmMakefile::GetConfigurations(std::vector<std::string>& configs,
+ bool single) const
+{
+ if(this->LocalGenerator->GetGlobalGenerator()->IsMultiConfig())
+ {
+ if(const char* configTypes =
+ this->GetDefinition("CMAKE_CONFIGURATION_TYPES"))
+ {
+ cmSystemTools::ExpandListArgument(configTypes, configs);
+ }
+ return 0;
+ }
+ else
+ {
+ const char* buildType = this->GetDefinition("CMAKE_BUILD_TYPE");
+ if(single && buildType && *buildType)
+ {
+ configs.push_back(buildType);
+ }
+ return buildType;
+ }
+}
+
#if defined(CMAKE_BUILD_WITH_CMAKE)
/**
* Find a source group whose regular expression matches the filename
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 4fae7ee..8b8a3f8 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -309,7 +309,11 @@ public:
{
return this->ProjectName.c_str();
}
-
+
+ /** Get the configurations to be generated. */
+ const char* GetConfigurations(std::vector<std::string>& configs,
+ bool single = true) const;
+
/**
* Set the name of the library.
*/
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 9611912..591b0d1 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1040,18 +1040,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
// Collect the set of configuration types.
std::vector<std::string> configNames;
- if(const char* configurationTypes =
- mf->GetDefinition("CMAKE_CONFIGURATION_TYPES"))
- {
- cmSystemTools::ExpandListArgument(configurationTypes, configNames);
- }
- else if(const char* buildType = mf->GetDefinition("CMAKE_BUILD_TYPE"))
- {
- if(*buildType)
- {
- configNames.push_back(buildType);
- }
- }
+ mf->GetConfigurations(configNames);
// Setup per-configuration property default values.
const char* configProps[] = {
-----------------------------------------------------------------------
Summary of changes:
Source/cmExportCommand.cxx | 12 ++--------
Source/cmGlobalXCodeGenerator.cxx | 20 +-----------------
Source/cmLocalGenerator.cxx | 38 ++++--------------------------------
Source/cmMakefile.cxx | 36 +++++++++++++++++++++++++---------
Source/cmMakefile.h | 6 ++++-
Source/cmTarget.cxx | 13 +-----------
6 files changed, 42 insertions(+), 83 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list