find_package fails for XCTest if CMAKE_SYSTEM_NAME is set to iOS (instead of Darwin)
Hi! I have an issue where find_package fails when setting CMAKE_SYSTEM_NAME
to iOS
(in CMake 3.14.1). It works if i specify CMAKE_SYSTEM_NAME
to Darwin
, but it should in my opinion work if specifying iOS, watchOS or tvOS as well, now that those platforms are first-class citizens as well. Otherwise i will loose the nice features added in 3.14.
The issue arose when i tried to utilize the first-class support for iOS in CMake, but still having XCTest-dependencies in my CMakeLists.txt file.
I get the following error:
CMake Error at /usr/local/Cellar/cmake/3.14.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find XCTest (missing: XCTest_LIBRARY XCTest_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.14.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/usr/local/Cellar/cmake/3.14.1/share/cmake/Modules/FindXCTest.cmake:84 (find_package_handle_standard_args)
MWMAudioKit/MWMAudioKit_Core/CoreMathVector-Tests/CMakeLists.txt:30 (find_package)
This issue was found when a user used my toolchain-file where i had implemented support for the new features added in CMake 3.14.
Original issue here: leetal/ios-cmake/issues/37