summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJon Olav Hauglid <jon.hauglid@oracle.com>2014-06-24 09:13:01 +0200
committerJon Olav Hauglid <jon.hauglid@oracle.com>2014-06-24 09:13:01 +0200
commit688416794ae69cc76bd6bc11d281705599700621 (patch)
tree4a121adea83c9186fe84ee917b7760329df42c98 /CMakeLists.txt
parent0e947e88b166c1b6e6ed82a13770c7e781a2b633 (diff)
downloadmariadb-git-688416794ae69cc76bd6bc11d281705599700621.tar.gz
Bug#19001781: ADD SUPPORT FOR CMAKE 3
Set CMP0026 and CMP0045 policies when using CMake version 3 or higher to restore old CMake behavior.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4a34d5fdbf5..f43473f76a5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,6 +25,14 @@ IF(CMAKE_VERSION VERSION_EQUAL "2.8.12" OR
CMAKE_POLICY(SET CMP0022 OLD)
ENDIF()
+# We use the LOCATION target property (CMP0026)
+# and get_target_property() for non-existent targets (CMP0045)
+IF(CMAKE_VERSION VERSION_EQUAL "3.0.0" OR
+ CMAKE_VERSION VERSION_GREATER "3.0.0")
+ CMAKE_POLICY(SET CMP0026 OLD)
+ CMAKE_POLICY(SET CMP0045 OLD)
+ENDIF()
+
MESSAGE(STATUS "Running cmake version ${CMAKE_VERSION}")
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)