diff options
author | David Cole <david.cole@kitware.com> | 2011-08-12 19:55:01 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2011-09-12 19:21:00 (GMT) |
commit | 59a22655765a46c48dc3f45189101f2e9a265776 (patch) | |
tree | c2e9debca4478352c116786395b694fd45a53f98 | |
parent | 74c73d5fa0af15c8316a4ab7cfe0aed0f39450f1 (diff) | |
download | CMake-59a22655765a46c48dc3f45189101f2e9a265776.zip CMake-59a22655765a46c48dc3f45189101f2e9a265776.tar.gz CMake-59a22655765a46c48dc3f45189101f2e9a265776.tar.bz2 |
Xcode: Use EFFECTIVE_PLATFORM_NAME reference in ComputeOutputDir
Caveats apply: only valid when not overriding default value for output
dir *and* there is a CMAKE_XCODE_EFFECTIVE_PLATFORMS value.
For now, CMAKE_XCODE_EFFECTIVE_PLATFORMS must be defined in each
project, or in the cache for a build.
Code relying on value of LOCATION and similar properties may not
work if it depends on file existence on disk since CMake will not
evaluate $(EFFECTIVE_PLATFORM_NAME). This feature is only enabled
for making it easier to build Xcode iOS projects where the developer
wants to be able to switch easily between simulator and device builds.
-rw-r--r-- | Source/cmTarget.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 2cb3c01..19ecbf0 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -3757,8 +3757,12 @@ bool cmTarget::ComputeOutputDir(const char* config, // The generator may add the configuration's subdirectory. if(config && *config) { + const char *platforms = this->Makefile->GetDefinition( + "CMAKE_XCODE_EFFECTIVE_PLATFORMS"); + std::string suffix = + usesDefaultOutputDir && platforms ? "$(EFFECTIVE_PLATFORM_NAME)" : ""; this->Makefile->GetLocalGenerator()->GetGlobalGenerator()-> - AppendDirectoryForConfig("/", config, "", out); + AppendDirectoryForConfig("/", config, suffix.c_str(), out); } return usesDefaultOutputDir; |