mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 08:20:18 -06:00
iOS: Allow specifying CMAKE_MACOSX_BUNDLE in toolchain file
Currently CMAKE_MACOSX_BUNDLE is always set to true when compiling for iOS. This poses a problem when using the source file variant of try_compile. Even if a custom value is passed via the CMAKE_FLAGS option, it would still be overridden by the Darwin.cmake file. Only set the value in case no other value was provided before.
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
set(APPLE 1)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS")
|
||||
set(CMAKE_MACOSX_BUNDLE ON)
|
||||
if(NOT DEFINED CMAKE_MACOSX_BUNDLE)
|
||||
set(CMAKE_MACOSX_BUNDLE ON)
|
||||
endif()
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH "${_CMAKE_OSX_SYSROOT_PATH}")
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
|
||||
Reference in New Issue
Block a user