From a1ce164d741a65e6e3b983b72e31bb4f8bb4c094 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Mon, 9 Nov 2020 16:06:57 +0100 Subject: [PATCH] CMake: Make zstd config-based lookup quiet Make zstd config based lookup quiet and check for version variable as required for ZSTD target. Add IMPORTED_LOCATION by default for pkg-config based search. Expect that select_library_configurations will set correct value for ZSTD_LIBRARY. Fixes: QTBUG-88091 Change-Id: Ia5079154ce4fc4eefbc0931317219b5ca0f3f82f Reviewed-by: Alexandru Croitor --- cmake/FindZSTD.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/FindZSTD.cmake b/cmake/FindZSTD.cmake index e9af76cc4e..67124719d9 100644 --- a/cmake/FindZSTD.cmake +++ b/cmake/FindZSTD.cmake @@ -18,12 +18,12 @@ # ``ZSTD::ZSTD`` # The zstd library -find_package(zstd CONFIG) +find_package(zstd CONFIG QUIET) include(FindPackageHandleStandardArgs) if(TARGET zstd::libzstd_static OR TARGET zstd::libzstd_shared) - find_package_handle_standard_args(ZSTD REQUIRED_VARS zstd_DIR VERSION_VAR zstd_VERSION) + find_package_handle_standard_args(ZSTD REQUIRED_VARS zstd_VERSION VERSION_VAR zstd_VERSION) if(TARGET zstd::libzstd_static) set(zstdtargetsuffix "_static") else() @@ -62,6 +62,8 @@ else() add_library(ZSTD::ZSTD UNKNOWN IMPORTED) set_target_properties(ZSTD::ZSTD PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${ZSTD_INCLUDE_DIRS}") + set_target_properties(ZSTD::ZSTD PROPERTIES + IMPORTED_LOCATION "${ZSTD_LIBRARY}") if(ZSTD_LIBRARY_RELEASE) set_target_properties(ZSTD::ZSTD PROPERTIES IMPORTED_LOCATION_RELEASE "${ZSTD_LIBRARY_RELEASE}")