Blame cmake/CheckCmakeCompat.cmake

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