Browse Source

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.).
Gregor Jasny 10 years ago
parent
commit
48fe617e66
2 changed files with 12 additions and 2 deletions
  1. 11 1
      Source/cmGlobalGenerator.cxx
  2. 1 1
      Source/cmTarget.cxx

+ 11 - 1
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");

+ 1 - 1
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);
     }