summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/FPHSA/FindNameMismatch.cmake
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2019-12-09 13:19:35 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2020-01-14 22:25:49 (GMT)
commitee4673c1ae1e4a1aa4687412717567c2ffbb501b (patch)
treed8fc21374a252ecd7ad9ad92e1921c42897b95a0 /Tests/RunCMake/FPHSA/FindNameMismatch.cmake
parent93526fd91319d952e60760c735a9bb191bc4ede3 (diff)
downloadCMake-ee4673c1ae1e4a1aa4687412717567c2ffbb501b.zip
CMake-ee4673c1ae1e4a1aa4687412717567c2ffbb501b.tar.gz
CMake-ee4673c1ae1e4a1aa4687412717567c2ffbb501b.tar.bz2
FPHSA: detect package name mismatches
The `FPHSA_NAME_MISMATCHED` variable may be set if this is intentional (but should be cleared after the call to not affect other FPHSA calls). It may also be passed via the `NAME_MISMATCHED` option for new-signature FPHSA calls.
Diffstat (limited to 'Tests/RunCMake/FPHSA/FindNameMismatch.cmake')
-rw-r--r--Tests/RunCMake/FPHSA/FindNameMismatch.cmake4
1 files changed, 4 insertions, 0 deletions
diff --git a/Tests/RunCMake/FPHSA/FindNameMismatch.cmake b/Tests/RunCMake/FPHSA/FindNameMismatch.cmake
new file mode 100644
index 0000000..540aa67
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/FindNameMismatch.cmake
@@ -0,0 +1,4 @@
+set("${CMAKE_FIND_PACKAGE_NAME}_MODULE" "${CMAKE_CURRENT_LIST_FILE}")
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(NAMEMISMATCH REQUIRED_VARS "${CMAKE_FIND_PACKAGE_NAME}_MODULE")
+set("${CMAKE_FIND_PACKAGE_NAME}_FOUND" 1)