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.).
This commit is contained in:
parent
d2c2319d64
commit
48fe617e66
|
@ -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");
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue