summaryrefslogtreecommitdiffstats
path: root/Tests/FindPackageTest/FindVersionTestA.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-09-10 14:11:48 (GMT)
committerBrad King <brad.king@kitware.com>2008-09-10 14:11:48 (GMT)
commit994262e5cc05abfb96da9af38f8d84988405ea5b (patch)
tree3fe840a4aadc7988608eb9e7491e6908f76b3649 /Tests/FindPackageTest/FindVersionTestA.cmake
parent4eaac32db62f96796fc6bfe09d5cc83ff1b15fe6 (diff)
downloadCMake-994262e5cc05abfb96da9af38f8d84988405ea5b.zip
CMake-994262e5cc05abfb96da9af38f8d84988405ea5b.tar.gz
CMake-994262e5cc05abfb96da9af38f8d84988405ea5b.tar.bz2
ENH: Improve find_package version numbering
Make the number of version components specified explicitly available. Set variables for unspecified version components to "0" instead of leaving them unset. This simplifies version number handling for find- and config-modules. Also support a fourth "tweak" version component since some packages use them.
Diffstat (limited to 'Tests/FindPackageTest/FindVersionTestA.cmake')
-rw-r--r--Tests/FindPackageTest/FindVersionTestA.cmake18
1 files changed, 12 insertions, 6 deletions
diff --git a/Tests/FindPackageTest/FindVersionTestA.cmake b/Tests/FindPackageTest/FindVersionTestA.cmake
index eedf371..55c67e2 100644
--- a/Tests/FindPackageTest/FindVersionTestA.cmake
+++ b/Tests/FindPackageTest/FindVersionTestA.cmake
@@ -4,9 +4,15 @@ ENDIF(NOT "${VersionTestA_FIND_VERSION}" STREQUAL "1")
IF(NOT "${VersionTestA_FIND_VERSION_MAJOR}" STREQUAL "1")
MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_MAJOR=${VersionTestA_FIND_VERSION_MAJOR} is not 1")
ENDIF(NOT "${VersionTestA_FIND_VERSION_MAJOR}" STREQUAL "1")
-IF(DEFINED VersionTestA_FIND_VERSION_MINOR)
- MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_MINOR should not be defined")
-ENDIF(DEFINED VersionTestA_FIND_VERSION_MINOR)
-IF(DEFINED VersionTestA_FIND_VERSION_PATCH)
- MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_PATCH should not be defined")
-ENDIF(DEFINED VersionTestA_FIND_VERSION_PATCH)
+IF(NOT "${VersionTestA_FIND_VERSION_MINOR}" STREQUAL "0")
+ MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_MINOR=${VersionTestA_FIND_VERSION_MINOR} is not 0")
+ENDIF(NOT "${VersionTestA_FIND_VERSION_MINOR}" STREQUAL "0")
+IF(NOT "${VersionTestA_FIND_VERSION_PATCH}" STREQUAL "0")
+ MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_PATCH=${VersionTestA_FIND_VERSION_PATCH} is not 0")
+ENDIF(NOT "${VersionTestA_FIND_VERSION_PATCH}" STREQUAL "0")
+IF(NOT "${VersionTestA_FIND_VERSION_TWEAK}" STREQUAL "0")
+ MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_TWEAK=${VersionTestA_FIND_VERSION_TWEAK} is not 0")
+ENDIF(NOT "${VersionTestA_FIND_VERSION_TWEAK}" STREQUAL "0")
+IF(NOT "${VersionTestA_FIND_VERSION_COUNT}" STREQUAL "1")
+ MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_COUNT=${VersionTestA_FIND_VERSION_COUNT} is not 1")
+ENDIF(NOT "${VersionTestA_FIND_VERSION_COUNT}" STREQUAL "1")