summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-10-21 17:00:49 (GMT)
committerBrad King <brad.king@kitware.com>2009-10-21 17:00:49 (GMT)
commit2dc39b8c329425cb54e5e111e2b00d79caa1db36 (patch)
tree516539dab9c55976dbf95cdc6896abacaff4ae7a /Source/cmTarget.cxx
parent2f94a2c919ddb39f33c47b4baa7bd37e2ae4cacd (diff)
downloadCMake-2dc39b8c329425cb54e5e111e2b00d79caa1db36.zip
CMake-2dc39b8c329425cb54e5e111e2b00d79caa1db36.tar.gz
CMake-2dc39b8c329425cb54e5e111e2b00d79caa1db36.tar.bz2
Define per-target OSX_ARCHITECTURES property
The CMAKE_OSX_ARCHITECTURES variable works only as a global setting. This commit defines target properties OSX_ARCHITECTURES OSX_ARCHITECTURES_<CONFIG> to specify OS X architectures on a per-target and per-configuration basis. See issue #8725.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx39
1 files changed, 39 insertions, 0 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index ccac68a..8b71505 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -573,6 +573,23 @@ void cmTarget::DefineProperties(cmake *cm)
false /* TODO: make this chained */ );
cm->DefineProperty
+ ("OSX_ARCHITECTURES", cmProperty::TARGET,
+ "Target specific architectures for OS X.",
+ "The OSX_ARCHITECTURES property sets the target binary architecture "
+ "for targets on OS X. "
+ "This property is initialized by the value of the variable "
+ "CMAKE_OSX_ARCHITECTURES if it is set when a target is created. "
+ "Use OSX_ARCHITECTURES_<CONFIG> to set the binary architectures on a "
+ "per-configuration basis. "
+ "<CONFIG> is an upper-case name (ex: \"OSX_ARCHITECTURES_DEBUG\").");
+
+ cm->DefineProperty
+ ("OSX_ARCHITECTURES_<CONFIG>", cmProperty::TARGET,
+ "Per-configuration OS X binary architectures for a target.",
+ "This property is the configuration-specific version of "
+ "OSX_ARCHITECTURES.");
+
+ cm->DefineProperty
("OUTPUT_NAME", cmProperty::TARGET,
"Output name for target files.",
"This sets the base name for output files created for an executable or "
@@ -988,6 +1005,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
this->SetPropertyDefault("LIBRARY_OUTPUT_DIRECTORY", 0);
this->SetPropertyDefault("RUNTIME_OUTPUT_DIRECTORY", 0);
this->SetPropertyDefault("Fortran_MODULE_DIRECTORY", 0);
+ this->SetPropertyDefault("OSX_ARCHITECTURES", 0);
// Collect the set of configuration types.
std::vector<std::string> configNames;
@@ -3653,6 +3671,27 @@ void cmTarget::GetLanguages(std::set<cmStdString>& languages) const
}
//----------------------------------------------------------------------------
+void cmTarget::GetAppleArchs(const char* config,
+ std::vector<std::string>& archVec)
+{
+ const char* archs = 0;
+ if(config && *config)
+ {
+ std::string defVarName = "OSX_ARCHITECTURES_";
+ defVarName += cmSystemTools::UpperCase(config);
+ archs = this->GetProperty(defVarName.c_str());
+ }
+ if(!archs)
+ {
+ archs = this->GetProperty("OSX_ARCHITECTURES");
+ }
+ if(archs)
+ {
+ cmSystemTools::ExpandListArgument(std::string(archs), archVec);
+ }
+}
+
+//----------------------------------------------------------------------------
bool cmTarget::IsChrpathUsed(const char* config)
{
#if defined(CMAKE_USE_ELF_PARSER)