diff options
author | Brad King <brad.king@kitware.com> | 2019-02-26 12:18:43 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-02-26 12:35:24 (GMT) |
commit | a0d4430d662be62af58c6ff8a9b75511b2cbbe5f (patch) | |
tree | 93805aefa7267bed69ba26f66f7ed17b81cd8f72 /Tests/RunCMake/CMakeLists.txt | |
parent | e6897c72e7c59f7a0b82ed19c1bdb40d42f7adaa (diff) | |
download | CMake-a0d4430d662be62af58c6ff8a9b75511b2cbbe5f.zip CMake-a0d4430d662be62af58c6ff8a9b75511b2cbbe5f.tar.gz CMake-a0d4430d662be62af58c6ff8a9b75511b2cbbe5f.tar.bz2 |
Tests: Restore support for CMake 3.1 through 3.6 with MSVC
The change in commit a5dd159990 (Tests: Fix RunCMake.try_compile
CxxStandard case on MSVC, 2017-09-22, v3.10.0-rc1~63^2) introduced use
of `if()` conditions not supported until CMake 3.7, so while it was
intended to restore support for CMake versions prior to 3.9, it actually
only did so for 3.7 and 3.8. Backport the logic to work with CMake 3.1.
Fixes: #18987
Diffstat (limited to 'Tests/RunCMake/CMakeLists.txt')
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 1f3e5c3..f2b7ff1 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -284,11 +284,11 @@ function(add_RunCMake_test_try_compile) if(CMAKE_VERSION VERSION_LESS 3.9.20170907 AND "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC") # Older CMake versions do not know about MSVC language standards. # Approximate our logic from MSVC-CXX.cmake. - if ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.0.24215.1 AND + if ((NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.24215.1 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.10) OR - CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.10.25017) + NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.10.25017) set(CMAKE_CXX_STANDARD_DEFAULT 14) - elseif (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0) + elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0) set(CMAKE_CXX_STANDARD_DEFAULT "") else() unset(CMAKE_CXX_STANDARD_DEFAULT) |