Replace CMAKE_XCODE_EFFECTIVE_PLATFORMS with call to PlatformIsAppleIos

Currently the CMAKE_XCODE_EFFECTIVE_PLATFORMS property acts only as
a kind of toggle switch to enable iOS project layout features.
But instead of relying on this undocumented property, better detect
the presence of an iOS SDK directly.
This commit is contained in:
Gregor Jasny 2015-08-20 22:29:49 +02:00
parent cdb9984bff
commit d2c2319d64
3 changed files with 2 additions and 5 deletions

View File

@ -3566,10 +3566,9 @@ bool cmTarget::ComputeOutputDir(const std::string& config,
// The generator may add the configuration's subdirectory. // The generator may add the configuration's subdirectory.
if(!conf.empty()) if(!conf.empty())
{ {
const char *platforms = this->Makefile->GetDefinition( bool iosPlatform = this->Makefile->PlatformIsAppleIos();
"CMAKE_XCODE_EFFECTIVE_PLATFORMS");
std::string suffix = std::string suffix =
usesDefaultOutputDir && platforms ? "$(EFFECTIVE_PLATFORM_NAME)" : ""; usesDefaultOutputDir && iosPlatform ? "$(EFFECTIVE_PLATFORM_NAME)" : "";
this->Makefile->GetGlobalGenerator()-> this->Makefile->GetGlobalGenerator()->
AppendDirectoryForConfig("/", conf, suffix, out); AppendDirectoryForConfig("/", conf, suffix, out);
} }

View File

@ -6,7 +6,6 @@ enable_language(C)
if(TEST_IOS) if(TEST_IOS)
set(CMAKE_OSX_SYSROOT iphoneos) set(CMAKE_OSX_SYSROOT iphoneos)
set(CMAKE_OSX_ARCHITECTURES "armv7") set(CMAKE_OSX_ARCHITECTURES "armv7")
set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimulator")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO") set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO") set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO")
endif(TEST_IOS) endif(TEST_IOS)

View File

@ -3,7 +3,6 @@ project(NavApp3)
set(CMAKE_OSX_SYSROOT iphoneos4.3) set(CMAKE_OSX_SYSROOT iphoneos4.3)
set(CMAKE_OSX_ARCHITECTURES "armv6;armv7;i386") set(CMAKE_OSX_ARCHITECTURES "armv6;armv7;i386")
set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimulator")
include_directories( include_directories(
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}