1 # Central location to check for cmake (version) requirements
3 #=============================================================================
4 # Copyright 2012 Bernhard Miklautz <bernhard.miklautz@thincast.com>
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #=============================================================================
19 macro(enable_cmake_compat CMVERSION)
20 if(${CMAKE_VERSION} VERSION_LESS ${CMVERSION})
21 LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/compat_${CMVERSION}/")
25 # Compatibility includes - order does matter!
26 enable_cmake_compat(3.7.0)
27 enable_cmake_compat(2.8.11)
28 enable_cmake_compat(2.8.6)
29 enable_cmake_compat(2.8.3)
30 enable_cmake_compat(2.8.2)
32 # GetGitRevisionDescription requires FindGit which was added in version 2.8.2
33 # build won't fail but GIT_REVISION is set to n/a
34 if(${CMAKE_VERSION} VERSION_LESS 2.8.2)
35 message(WARNING "GetGitRevisionDescription reqires (FindGit) cmake >= 2.8.2 to work properly - GIT_REVISION will be set to n/a")
38 # Since cmake 2.8.9 modules/library names without lib/.so can be used
40 if(IOS AND ${CMAKE_VERSION} VERSION_LESS 2.8.9)
41 message(FATAL_ERROR "CMAKE version >= 2.8.9 required to build the IOS client")