diff options
author | Brad King <brad.king@kitware.com> | 2013-10-18 15:25:49 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-10-23 12:54:31 (GMT) |
commit | 7d47c693650672afabc46bd200246eb9130582d6 (patch) | |
tree | 0a1ad731d0622c629584a6518e124dfb8e7b5661 /Tests/RunCMake | |
parent | c7c44fc7f4a32163b9fd82e5560fa35df60d2fb4 (diff) | |
download | CMake-7d47c693650672afabc46bd200246eb9130582d6.zip CMake-7d47c693650672afabc46bd200246eb9130582d6.tar.gz CMake-7d47c693650672afabc46bd200246eb9130582d6.tar.bz2 |
Drop compatibility with CMake < 2.4
Drop all behavior activated by setting CMAKE_BACKWARDS_COMPATIBILITY to
a value lower than 2.4, and generate an error when projects or the user
attempt to do so. In the error suggest using a CMake 2.8.x release.
Teach cmake_minimum_required to warn about projects that do not require
at least CMake 2.4. They are not supported by CMake >= 3.0.
Replace the documentation of CMAKE_BACKWARDS_COMPATIBILITY with a
reference to policy CMP0001.
Diffstat (limited to 'Tests/RunCMake')
11 files changed, 32 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 8148cb6..e84aba2 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -93,6 +93,7 @@ add_RunCMake_test(Syntax) add_RunCMake_test(add_dependencies) add_RunCMake_test(build_command) +add_RunCMake_test(cmake_minimum_required) add_RunCMake_test(find_package) add_RunCMake_test(get_filename_component) add_RunCMake_test(if) diff --git a/Tests/RunCMake/cmake_minimum_required/Before24-stderr.txt b/Tests/RunCMake/cmake_minimum_required/Before24-stderr.txt new file mode 100644 index 0000000..4a6f16d --- /dev/null +++ b/Tests/RunCMake/cmake_minimum_required/Before24-stderr.txt @@ -0,0 +1,5 @@ +CMake Warning \(dev\) at Before24.cmake:1 \(cmake_minimum_required\): + Compatibility with CMake < 2.4 is not supported by CMake >= 3.0. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/cmake_minimum_required/Before24.cmake b/Tests/RunCMake/cmake_minimum_required/Before24.cmake new file mode 100644 index 0000000..c28fc8a --- /dev/null +++ b/Tests/RunCMake/cmake_minimum_required/Before24.cmake @@ -0,0 +1 @@ +cmake_minimum_required(VERSION 2.2) diff --git a/Tests/RunCMake/cmake_minimum_required/CMakeLists.txt b/Tests/RunCMake/cmake_minimum_required/CMakeLists.txt new file mode 100644 index 0000000..e8db6b0 --- /dev/null +++ b/Tests/RunCMake/cmake_minimum_required/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/cmake_minimum_required/CompatBefore24-result.txt b/Tests/RunCMake/cmake_minimum_required/CompatBefore24-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/cmake_minimum_required/CompatBefore24-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/cmake_minimum_required/CompatBefore24-stderr.txt b/Tests/RunCMake/cmake_minimum_required/CompatBefore24-stderr.txt new file mode 100644 index 0000000..a874466 --- /dev/null +++ b/Tests/RunCMake/cmake_minimum_required/CompatBefore24-stderr.txt @@ -0,0 +1,5 @@ +CMake Error in CMakeLists.txt: + You have set CMAKE_BACKWARDS_COMPATIBILITY to a CMake version less than + 2.4. This version of CMake only supports backwards compatibility with + CMake 2.4 or later. For compatibility with older versions please use any + CMake 2.8.x release or lower. diff --git a/Tests/RunCMake/cmake_minimum_required/CompatBefore24.cmake b/Tests/RunCMake/cmake_minimum_required/CompatBefore24.cmake new file mode 100644 index 0000000..ca0cb1d --- /dev/null +++ b/Tests/RunCMake/cmake_minimum_required/CompatBefore24.cmake @@ -0,0 +1,2 @@ +cmake_minimum_required(VERSION 2.4) +set(CMAKE_BACKWARDS_COMPATIBILITY 2.2) diff --git a/Tests/RunCMake/cmake_minimum_required/PolicyBefore24-result.txt b/Tests/RunCMake/cmake_minimum_required/PolicyBefore24-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/cmake_minimum_required/PolicyBefore24-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/cmake_minimum_required/PolicyBefore24-stderr.txt b/Tests/RunCMake/cmake_minimum_required/PolicyBefore24-stderr.txt new file mode 100644 index 0000000..840211a --- /dev/null +++ b/Tests/RunCMake/cmake_minimum_required/PolicyBefore24-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at PolicyBefore24.cmake:2 \(cmake_policy\): + Compatibility with CMake < 2.4 is not supported by CMake >= 3.0. For + compatibility with older versions please use any CMake 2.8.x release or + lower. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/cmake_minimum_required/PolicyBefore24.cmake b/Tests/RunCMake/cmake_minimum_required/PolicyBefore24.cmake new file mode 100644 index 0000000..62d3836 --- /dev/null +++ b/Tests/RunCMake/cmake_minimum_required/PolicyBefore24.cmake @@ -0,0 +1,2 @@ +cmake_minimum_required(VERSION 2.4) +cmake_policy(VERSION 2.2) diff --git a/Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake b/Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake new file mode 100644 index 0000000..e4c65e3 --- /dev/null +++ b/Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +run_cmake(Before24) +run_cmake(CompatBefore24) +run_cmake(PolicyBefore24) |