[cmake-developers] [CMake 0015669]: XCTest for iOS target has incorrect TEST_HOST

Gregor Jasny gjasny at googlemail.com
Wed Aug 19 15:46:05 EDT 2015


Hello,

On 30/07/15 16:03, Brad King wrote:
> On 07/30/2015 07:38 AM, Gregor Jasny via cmake-developers wrote:
>> Do you have a better idea to detect the usage of iphone/simulator SDK?
>> Maybe we should handle this in the platform Darwin modules?
> 
> This occurs when cross-compiling to iOS, so should we check for
> CMAKE_SYSTEM_NAME set to "iOS"?  There is already code to do this
> for Android.

The problem I see with this approach is that CMake provides no official
iOS toolchain file (maybe we should?). And the popular cmake-ios project
[1] for example sets SYSTEM_NAME to Darwin.

Maybe we can detect iOS via SDK string for now. If there is a better way
to detect iOS the PlatformIsAppleIos() could easily be changed.

I pushed the ios-app-bundle-layout topic branch together with a test
case. Some words about the patch:

I decided to put the iOS platform detection into cmMakefile and not
cmTarget because I'll need it for another bug (iOS install #12506) later
within cmGlobalGenerator::CreateDefaultGlobalTargets where no target is
available. I also thought about just providing a static function which
only performs the string comparisons but could not find a proper place
for it. From my gut feeling I would have placed it somewhere in a
*Xcode* file. But as far as I understand these files are not built on
non-Apple platforms which would uglify the generic callers.

Please review the topic branch. If you think it would make sense to see
also the ios-install patch and review both in parallel,  I could polish
and push it within the next days.

Thanks,
Gregor

[1] https://code.google.com/p/ios-cmake/source/browse/toolchain/iOS.cmake


More information about the cmake-developers mailing list