summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/FPHSA/RunCMakeTest.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-09-15 14:52:23 (GMT)
committerBrad King <brad.king@kitware.com>2022-09-15 15:00:02 (GMT)
commit07f0a78874e0cf8013654ff4bac5e7192a324609 (patch)
tree963c5a09903c69978de7973d639f959f6c8bff64 /Tests/RunCMake/FPHSA/RunCMakeTest.cmake
parent01a25d72c69b0a9a60c1a62939d6a2c543448118 (diff)
downloadCMake-07f0a78874e0cf8013654ff4bac5e7192a324609.zip
CMake-07f0a78874e0cf8013654ff4bac5e7192a324609.tar.gz
CMake-07f0a78874e0cf8013654ff4bac5e7192a324609.tar.bz2
FPHSA: Fix regression when VERSION_VAR is missing
If a package is found but FPHSA is called by the find module without a `VERSION_VAR`, and the `find_package` call specifies a version, we have previously accepted the package as found. This was accidentally regressed by commit 8f50f135ae (FPHSA: Improve error message when VERSION_VAR is empty or has been unset(), 2022-08-01). Restore it and add a test case.
Diffstat (limited to 'Tests/RunCMake/FPHSA/RunCMakeTest.cmake')
-rw-r--r--Tests/RunCMake/FPHSA/RunCMakeTest.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/Tests/RunCMake/FPHSA/RunCMakeTest.cmake b/Tests/RunCMake/FPHSA/RunCMakeTest.cmake
index e389e6b..3b095a6 100644
--- a/Tests/RunCMake/FPHSA/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FPHSA/RunCMakeTest.cmake
@@ -44,6 +44,9 @@ run_cmake(exact_0_matching)
set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" "-DPseudo_VERSION=")
run_cmake(empty_version)
+set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}")
+run_cmake(exact_1_no_version_var)
+
# check custom error message
set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" "-DCustomMessage_VERSION=1.2.3.4")
run_cmake(custom_message_1)