From 48fe617e667d2e6b1e471cfb56346de51f984ba5 Mon Sep 17 00:00:00 2001 From: Gregor Jasny Date: Thu, 13 Aug 2015 13:03:02 +0300 Subject: Fix installation of iOS targets (#12506) Since cmTarget::ComputeOutputDir results can be used in CMake code of script cmake_install.cmake and in Xcode internals, string ${EFFECTIVE_PLATFORM_NAME} should be used instead of $(EFFECTIVE_PLATFORM_NAME) because it works for both. Value of CMAKE_CFG_INTDIR can't be used in BUILD_TYPE argument of install command since it contains $(EFFECTIVE_PLATFORM_NAME) (e.g. equals to `Release-iphoneos`, `Debug-iphoneos`, etc.). --- Source/cmGlobalGenerator.cxx | 12 +++++++++++- Source/cmTarget.cxx | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 503c455..40f1fcf 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2427,7 +2427,17 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) if ( cmakeCfgIntDir && *cmakeCfgIntDir && cmakeCfgIntDir[0] != '.' ) { std::string cfgArg = "-DBUILD_TYPE="; - cfgArg += mf->GetDefinition("CMAKE_CFG_INTDIR"); + bool iosPlatform = mf->PlatformIsAppleIos(); + if(iosPlatform) + { + cfgArg += "$(CONFIGURATION)"; + singleLine.push_back(cfgArg); + cfgArg = "-DEFFECTIVE_PLATFORM_NAME=$(EFFECTIVE_PLATFORM_NAME)"; + } + else + { + cfgArg += mf->GetDefinition("CMAKE_CFG_INTDIR"); + } singleLine.push_back(cfgArg); } singleLine.push_back("-P"); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index da314a6..d6d509c 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -3568,7 +3568,7 @@ bool cmTarget::ComputeOutputDir(const std::string& config, { bool iosPlatform = this->Makefile->PlatformIsAppleIos(); std::string suffix = - usesDefaultOutputDir && iosPlatform ? "$(EFFECTIVE_PLATFORM_NAME)" : ""; + usesDefaultOutputDir && iosPlatform ? "${EFFECTIVE_PLATFORM_NAME}" : ""; this->Makefile->GetGlobalGenerator()-> AppendDirectoryForConfig("/", conf, suffix, out); } -- cgit v0.12