summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-08-24 14:07:02 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-08-24 14:07:02 (GMT)
commit58043880b944b1fc09d55f44f4abb4a52adfd288 (patch)
tree7b9755b472f3614b610b5d41223e6cc8dedabc73 /Source
parenteeeb0eb751d98c73fefd42d50f9c92fb7af1e0e8 (diff)
parent744e6c497c01cb3a3129ca66d1cabfa83e17dbd4 (diff)
downloadCMake-58043880b944b1fc09d55f44f4abb4a52adfd288.zip
CMake-58043880b944b1fc09d55f44f4abb4a52adfd288.tar.gz
CMake-58043880b944b1fc09d55f44f4abb4a52adfd288.tar.bz2
Merge topic 'ios-app-bundle-layout'
744e6c49 Fix iOS Bundle layouts (#15669)
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGeneratorTarget.cxx30
-rw-r--r--Source/cmMakefile.cxx12
-rw-r--r--Source/cmMakefile.h3
3 files changed, 35 insertions, 10 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 1a7b843..dd58e7b 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -973,9 +973,13 @@ cmGeneratorTarget::GetAppBundleDirectory(const std::string& config,
bool contentOnly) const
{
std::string fpath = this->GetFullName(config, false);
- fpath += ".app/Contents";
- if(!contentOnly)
- fpath += "/MacOS";
+ fpath += ".app";
+ if(!this->Makefile->PlatformIsAppleIos())
+ {
+ fpath += "/Contents";
+ if(!contentOnly)
+ fpath += "/MacOS";
+ }
return fpath;
}
@@ -1007,9 +1011,12 @@ std::string cmGeneratorTarget::GetCFBundleDirectory(const std::string& config,
}
}
fpath += ext;
- fpath += "/Contents";
- if(!contentOnly)
- fpath += "/MacOS";
+ if(!this->Makefile->PlatformIsAppleIos())
+ {
+ fpath += "/Contents";
+ if(!contentOnly)
+ fpath += "/MacOS";
+ }
return fpath;
}
@@ -1021,7 +1028,7 @@ cmGeneratorTarget::GetFrameworkDirectory(const std::string& config,
std::string fpath;
fpath += this->GetOutputName(config, false);
fpath += ".framework";
- if(!rootDir)
+ if(!rootDir && !this->Makefile->PlatformIsAppleIos())
{
fpath += "/Versions/";
fpath += this->Target->GetFrameworkVersion();
@@ -2168,9 +2175,12 @@ void cmGeneratorTarget::GetLibraryNames(std::string& name,
if(this->Target->IsFrameworkOnApple())
{
realName = prefix;
- realName += "Versions/";
- realName += this->Target->GetFrameworkVersion();
- realName += "/";
+ if(!this->Makefile->PlatformIsAppleIos())
+ {
+ realName += "Versions/";
+ realName += this->Target->GetFrameworkVersion();
+ realName += "/";
+ }
realName += base;
soName = realName;
}
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 85bc493..6e43b52 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2529,6 +2529,18 @@ bool cmMakefile::PlatformIs64Bit() const
return false;
}
+bool cmMakefile::PlatformIsAppleIos() const
+{
+ std::string sdkRoot;
+ sdkRoot = this->GetSafeDefinition("CMAKE_OSX_SYSROOT");
+ sdkRoot = cmSystemTools::LowerCase(sdkRoot);
+
+ return sdkRoot.find("iphoneos") == 0 ||
+ sdkRoot.find("/iphoneos") != std::string::npos ||
+ sdkRoot.find("iphonesimulator") == 0 ||
+ sdkRoot.find("/iphonesimulator") != std::string::npos;
+}
+
const char* cmMakefile::GetSONameFlag(const std::string& language) const
{
std::string name = "CMAKE_SHARED_LIBRARY_SONAME";
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 1c4da00..9f455cc 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -490,6 +490,9 @@ public:
/** Return whether the target platform is 64-bit. */
bool PlatformIs64Bit() const;
+ /** Return whether the target platform is Apple iOS. */
+ bool PlatformIsAppleIos() const;
+
/** Retrieve soname flag for the specified language if supported */
const char* GetSONameFlag(const std::string& language) const;