diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2020-08-06 16:38:04 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2020-08-07 13:41:38 (GMT) |
commit | 98844ec9db5fe4dc4e236f3852d4f3e88a4a9e76 (patch) | |
tree | 0990a65c3e2e9b4cbc6370c285290b8b1a28ca35 /Modules/FindQt4.cmake | |
parent | d421274e3e11a0e6480358faa8a8e5cf48d7b3c2 (diff) | |
download | CMake-98844ec9db5fe4dc4e236f3852d4f3e88a4a9e76.zip CMake-98844ec9db5fe4dc4e236f3852d4f3e88a4a9e76.tar.gz CMake-98844ec9db5fe4dc4e236f3852d4f3e88a4a9e76.tar.bz2 |
FPHSA: detect inclusion between find modules
Various find modules include each other to delegate finding some subset
or variant of the package. Ideally, these would use `find_dependency` or
some other actual `find_package` mechanism, but that is a larger change.
Instead, just detect inclusion and suppress FPHSA name mismatch
warnings.
Fixes: #21060
Diffstat (limited to 'Modules/FindQt4.cmake')
-rw-r--r-- | Modules/FindQt4.cmake | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 3993968..2e3da74 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -1318,10 +1318,18 @@ if (NOT QT_VERSION_MAJOR EQUAL 4) endif() endif() else() + if (CMAKE_FIND_PACKAGE_NAME STREQUAL "Qt") + # FindQt include()'s this module. It's an old pattern, but rather than + # trying to suppress this from outside the module (which is then sensitive + # to the contents, detect the case in this module and suppress it + # explicitly. + set(FPHSA_NAME_MISMATCHED 1) + endif () FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qt4 FOUND_VAR Qt4_FOUND REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} VERSION_VAR QTVERSION ) + unset(FPHSA_NAME_MISMATCHED) endif() ####################################### |