summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeTests
diff options
context:
space:
mode:
authorChuck Atkins <chuck.atkins@kitware.com>2016-08-05 18:11:46 (GMT)
committerBrad King <brad.king@kitware.com>2016-08-09 13:30:34 (GMT)
commit02d177c9cc05514baccfa530ab85eec65374fbcb (patch)
tree2fbef7a16d4acac2b3b7218ef1abd16690566d9a /Tests/CMakeTests
parent93b705a396c23f771ba203efb6f2f4934ae027b7 (diff)
downloadCMake-02d177c9cc05514baccfa530ab85eec65374fbcb.zip
CMake-02d177c9cc05514baccfa530ab85eec65374fbcb.tar.gz
CMake-02d177c9cc05514baccfa530ab85eec65374fbcb.tar.bz2
Add additional <= and >= comparison operators
This adds the LESS_EQUAL, GREATER_EQUAL, and associated STR and VERSION equivalents to use the combined <= and >= functionality.
Diffstat (limited to 'Tests/CMakeTests')
-rw-r--r--Tests/CMakeTests/VersionTest.cmake.in14
1 files changed, 14 insertions, 0 deletions
diff --git a/Tests/CMakeTests/VersionTest.cmake.in b/Tests/CMakeTests/VersionTest.cmake.in
index 4e946ab..f045605 100644
--- a/Tests/CMakeTests/VersionTest.cmake.in
+++ b/Tests/CMakeTests/VersionTest.cmake.in
@@ -83,10 +83,24 @@ foreach(v IN LISTS LESSV)
message(FATAL_ERROR "${CMAKE_MATCH_2} is less than ${CMAKE_MATCH_1}?")
endif()
+ # check greater or equal (same as less negative)
+ if(CMAKE_MATCH_2 VERSION_GREATER_EQUAL CMAKE_MATCH_1)
+ message(STATUS "${CMAKE_MATCH_2} is not less than ${CMAKE_MATCH_1}")
+ else()
+ message(FATAL_ERROR "${CMAKE_MATCH_2} is less than ${CMAKE_MATCH_1}?")
+ endif()
+
# check greater negative case
if(NOT CMAKE_MATCH_1 VERSION_GREATER CMAKE_MATCH_2)
message(STATUS "${CMAKE_MATCH_1} is not greater than ${CMAKE_MATCH_2}")
else()
message(FATAL_ERROR "${CMAKE_MATCH_1} is greater than ${CMAKE_MATCH_2}?")
endif()
+
+ # check less or equal (same as greater negative) case
+ if(CMAKE_MATCH_1 VERSION_LESS_EQUAL CMAKE_MATCH_2)
+ message(STATUS "${CMAKE_MATCH_1} is not greater than ${CMAKE_MATCH_2}")
+ else()
+ message(FATAL_ERROR "${CMAKE_MATCH_1} is greater than ${CMAKE_MATCH_2}?")
+ endif()
endforeach()