leetal / ios-cmake

A CMake toolchain file for iOS/iPadOS, visionOS, macOS, watchOS & tvOS C/C++/Obj-C++ development
BSD 3-Clause "New" or "Revised" License
1.89k stars 448 forks source link

example: avoid cmake_minimum deprecation warning #184

Closed scivision closed 2 months ago

scivision commented 1 year ago

Apple Silicon in general requires CMake >= 3.19.2, so it's unlikely to be an issue.

This avoids warning with CMake >= 3.27:

 % cmake -Bbuild -G Xcode -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DPLATFORM=OS64

CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

leetal commented 1 year ago

Seems the enable_language() directives are needed. Moving them (CXX, OBJC) to the project-definition causes issues since the toolchain require explicit language support and the project definition is not propagating to the correct internal directives in CMake..?