Blame cmake/CheckCmakeCompat.cmake

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