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.
This commit is contained in:
David Cole 2011-08-12 15:55:01 -04:00
parent 74c73d5fa0
commit 59a2265576
1 changed files with 5 additions and 1 deletions

View File

@ -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;