From 59a22655765a46c48dc3f45189101f2e9a265776 Mon Sep 17 00:00:00 2001 From: David Cole Date: Fri, 12 Aug 2011 15:55:01 -0400 Subject: 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. --- Source/cmTarget.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; -- cgit v0.12