summaryrefslogtreecommitdiffstats
path: root/cmake/FindZSTD.cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-08-04 17:24:17 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-08-10 11:56:54 +0200
commit3c52f8af9dbc125eee22115910c25510df8fede0 (patch)
tree3a3d7c60c53cb3c49b506ca721afcce249311c15 /cmake/FindZSTD.cmake
parent7e7796fb006e616537a31112438232c124e8ce35 (diff)
CMake: pro2cmake: Specify library versions for 3rd party libraries
If certain 3rd party libraries have a version that's not suitable for Qt, the configure summary should say so, rather than use them and fail at build time. With the current situation, we have to duplicate the version information from the configure.json files in helper.py, by assigning the version number as an extra find_package variable. Rerunning configurejson2cmake then embeds this version info into the qt_find_package calls in configure.cmake. Some of the Find modules are rewritten to take the specified version into account when looking for the libraries. This involves moving around the code for creating a target, after calling find_package_handle_standard_args() so we know if a good enough version was found. Task-number: QTBUG-82917 Change-Id: I139748d8090e0630cda413362760034dc3483e11 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake/FindZSTD.cmake')
-rw-r--r--cmake/FindZSTD.cmake3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmake/FindZSTD.cmake b/cmake/FindZSTD.cmake
index 57fe8d1c3a..11515c8a31 100644
--- a/cmake/FindZSTD.cmake
+++ b/cmake/FindZSTD.cmake
@@ -32,7 +32,8 @@ find_library(ZSTD_LIBRARIES
)
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(ZSTD DEFAULT_MSG ZSTD_LIBRARIES ZSTD_INCLUDE_DIRS)
+find_package_handle_standard_args(ZSTD REQUIRED_VARS ZSTD_LIBRARIES ZSTD_INCLUDE_DIRS
+ VERSION_VAR PC_ZSTD_VERSION)
if(ZSTD_FOUND AND NOT TARGET ZSTD::ZSTD)
add_library(ZSTD::ZSTD UNKNOWN IMPORTED)