summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2022-06-30 17:11:27 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-07-05 15:45:28 +0000
commit033979d5e3f0fbfec5401d4e28010aa99ff120f4 (patch)
tree526c96bf9c348083e9988e31d9458ac46f9c6dba /cmake
parent1402ebd7ed929568426bccf44c869ca3bf93af16 (diff)
CMake: Fix confusing FPHSA zstd version warning message
Previously if zstd was not found, one would see such a warning message Could NOT find WrapZSTD: Found unsuitable version "", but required is at least "1.3" (found ZSTD_LIBRARY-NOTFOUND) This is because PC_ZSTD_VERSION was a defined variable with an empty value, which makes FPHSA believe that a version was extracted from somewhere. Avoid passing that value directly. Now the warning message is Could NOT find WrapZSTD (missing: ZSTD_LIBRARIES ZSTD_INCLUDE_DIRS) (Required is at least version "1.3") Change-Id: I88760d94db0d869d328085996298f4aaa88bc6c2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit d59628881e0b35d10fa4cf7ba7b892b07cc18106) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindWrapZSTD.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmake/FindWrapZSTD.cmake b/cmake/FindWrapZSTD.cmake
index e619d78c86..d088e94cc7 100644
--- a/cmake/FindWrapZSTD.cmake
+++ b/cmake/FindWrapZSTD.cmake
@@ -56,9 +56,12 @@ else()
include(SelectLibraryConfigurations)
select_library_configurations(ZSTD)
+ if(PC_ZSTD_VERSION)
+ set(WrapZSTD_VERSION "${PC_ZSTD_VERSION}")
+ endif()
find_package_handle_standard_args(WrapZSTD
REQUIRED_VARS ZSTD_LIBRARIES ZSTD_INCLUDE_DIRS
- VERSION_VAR PC_ZSTD_VERSION)
+ VERSION_VAR WrapZSTD_VERSION)
if(WrapZSTD_FOUND AND NOT TARGET WrapZSTD::WrapZSTD)
add_library(WrapZSTD::WrapZSTD UNKNOWN IMPORTED)