summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/Darwin.cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-04-30 11:31:16 (GMT)
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-04-30 11:40:31 (GMT)
commit101135069425a1f3af85aa7d1fedf2656d9674f0 (patch)
tree3b9e9be5c333dd2e2aa248b96c70c83ed093f51d /Modules/Platform/Darwin.cmake
parent4eebc52eca3d551423d7e512284a3b71e13d30a0 (diff)
downloadCMake-101135069425a1f3af85aa7d1fedf2656d9674f0.zip
CMake-101135069425a1f3af85aa7d1fedf2656d9674f0.tar.gz
CMake-101135069425a1f3af85aa7d1fedf2656d9674f0.tar.bz2
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.
Diffstat (limited to 'Modules/Platform/Darwin.cmake')
-rw-r--r--Modules/Platform/Darwin.cmake4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index 5590433..9301ec9 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -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)