Browse Source

CMake: Bump minimum version when building for iOS

The build system for iOS and method for finding its thirdparty libraries relies on behavior that is only present in CMake 3.14 or higher.
Donny Lawrence 6 years ago
parent
commit
3b1d3deabe
1 changed files with 14 additions and 6 deletions
  1. 14 6
      CMakeLists.txt

+ 14 - 6
CMakeLists.txt

@@ -1,7 +1,20 @@
-cmake_minimum_required(VERSION 3.0.2)
+if(CMAKE_SYSTEM_NAME STREQUAL iOS)
+  cmake_minimum_required(VERSION 3.14)
+else()
+  cmake_minimum_required(VERSION 3.0.2)
+endif()
+
 set(CMAKE_DISABLE_SOURCE_CHANGES ON) # Must go before project() below
 set(CMAKE_DISABLE_SOURCE_CHANGES ON) # Must go before project() below
 set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) # Must go before project() below
 set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) # Must go before project() below
 
 
+get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+
+if(${CMAKE_VERSION} VERSION_GREATER 3.8.0)
+  # When using the Xcode generator, don't append the platform name to the
+  # intermediate configuration directory.
+  set_property(GLOBAL PROPERTY XCODE_EMIT_EFFECTIVE_PLATFORM_NAME OFF)
+endif()
+
 # Figure out the version
 # Figure out the version
 file(STRINGS "setup.cfg" _version REGEX "^version = ")
 file(STRINGS "setup.cfg" _version REGEX "^version = ")
 string(REGEX REPLACE "^.*= " "" _version "${_version}")
 string(REGEX REPLACE "^.*= " "" _version "${_version}")
@@ -17,11 +30,6 @@ string(REPLACE "$(EFFECTIVE_PLATFORM_NAME)" "" PANDA_CFG_INTDIR "${CMAKE_CFG_INT
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/macros/")
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/macros/")
 
 
-if(CMAKE_VERSION VERSION_GREATER "3.8")
-  # When using the Xcode generator, don't append the platform name to the
-  # intermediate configuration directory.
-  set_property(GLOBAL PROPERTY XCODE_EMIT_EFFECTIVE_PLATFORM_NAME OFF)
-endif()
 
 
 # Include global modules needed for configure scripts
 # Include global modules needed for configure scripts
 include(PackageConfig)      # Defines package_option
 include(PackageConfig)      # Defines package_option