Backported #6865: Disable websockets command line option
[platform/upstream/freerdp.git] / cmake / CheckCmakeCompat.cmake
1 # Central location to check for cmake (version) requirements
2 #
3 #=============================================================================
4 # Copyright 2012 Bernhard Miklautz <bernhard.miklautz@thincast.com>
5 #
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
9 #
10 #     http://www.apache.org/licenses/LICENSE-2.0
11 #
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 #=============================================================================
18
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}/")
22         endif()
23 endmacro()
24
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)
31
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")
36 endif()
37
38 # Since cmake 2.8.9 modules/library names without lib/.so can be used
39 # for dependencies
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")
42 endif()