diff options
author | Brad King <brad.king@kitware.com> | 2018-03-26 15:12:50 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-03-26 15:31:08 (GMT) |
commit | 8dc97acb03db6d3d2f9effd84fd81432a68aa23c (patch) | |
tree | c9f3414a235dc540c6c7121465fa17d7145a3e74 /Tests | |
parent | 6792c7787aedc0fb2a32b6ca563917f7447f2e80 (diff) | |
download | CMake-8dc97acb03db6d3d2f9effd84fd81432a68aa23c.zip CMake-8dc97acb03db6d3d2f9effd84fd81432a68aa23c.tar.gz CMake-8dc97acb03db6d3d2f9effd84fd81432a68aa23c.tar.bz2 |
cmake_minimum_required: Tolerate unknown future arguments
When a `...<max>` version is given that is larger than the running
version of CMake, assume that the project is aware of a newer version of
CMake and that any unknown arguments are future arguments. This will
allow future versions of CMake to add arguments to the command that
projects can use without introducing errors in older versions of CMake
(back to 3.12).
Diffstat (limited to 'Tests')
5 files changed, 9 insertions, 0 deletions
diff --git a/Tests/RunCMake/cmake_minimum_required/Future.cmake b/Tests/RunCMake/cmake_minimum_required/Future.cmake new file mode 100644 index 0000000..2b5c445 --- /dev/null +++ b/Tests/RunCMake/cmake_minimum_required/Future.cmake @@ -0,0 +1 @@ +cmake_minimum_required(VERSION 3.11...99.0 SOME_FUTURE_OPTION) diff --git a/Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake b/Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake index 22aa5b7..1030211 100644 --- a/Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake +++ b/Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake @@ -2,6 +2,8 @@ include(RunCMake) run_cmake(Before24) run_cmake(CompatBefore24) +run_cmake(Future) run_cmake(PolicyBefore24) run_cmake(Range) run_cmake(RangeBad) +run_cmake(Unknown) diff --git a/Tests/RunCMake/cmake_minimum_required/Unknown-result.txt b/Tests/RunCMake/cmake_minimum_required/Unknown-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/cmake_minimum_required/Unknown-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/cmake_minimum_required/Unknown-stderr.txt b/Tests/RunCMake/cmake_minimum_required/Unknown-stderr.txt new file mode 100644 index 0000000..d698642 --- /dev/null +++ b/Tests/RunCMake/cmake_minimum_required/Unknown-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at Unknown.cmake:1 \(cmake_minimum_required\): + cmake_minimum_required called with unknown argument "SOME_UNKNOWN_OPTION". +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/cmake_minimum_required/Unknown.cmake b/Tests/RunCMake/cmake_minimum_required/Unknown.cmake new file mode 100644 index 0000000..6c70f91 --- /dev/null +++ b/Tests/RunCMake/cmake_minimum_required/Unknown.cmake @@ -0,0 +1 @@ +cmake_minimum_required(VERSION 3.11 SOME_UNKNOWN_OPTION) |