CMake: Unify usage of pkg_check_modules
According to the CMake documentation, IMPORTED_TARGET should be specified before the moduleSpec, and after QUIET. Additionally, double-quote the moduleSpec everywhere, since before, it was only quoted in some cases. While this is not required for pkg_check_modules to work, it unifies the coding style. Pick-to: 6.5 Change-Id: Ic8ad708a8146f9b39ee40e9a719412441e231452 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This commit is contained in:
parent
c107525edb
commit
029e118a4e
@ -3,7 +3,7 @@
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
|
||||
pkg_check_modules(ATSPI2 atspi-2 IMPORTED_TARGET)
|
||||
pkg_check_modules(ATSPI2 IMPORTED_TARGET "atspi-2")
|
||||
|
||||
if (NOT TARGET PkgConfig::ATSPI2)
|
||||
set(ATSPI2_FOUND 0)
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
|
||||
pkg_check_modules(DirectFB directfb IMPORTED_TARGET)
|
||||
pkg_check_modules(DirectFB IMPORTED_TARGET "directfb")
|
||||
|
||||
if (NOT TARGET PkgConfig::DirectFB)
|
||||
set(DirectFB_FOUND 0)
|
||||
|
@ -2,9 +2,9 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_GSSAPI QUIET krb5-gssapi)
|
||||
pkg_check_modules(PC_GSSAPI QUIET "krb5-gssapi")
|
||||
if (NOT PC_GSSAPI_FOUND)
|
||||
pkg_check_modules(PC_GSSAPI QUIET mit-krb5-gssapi)
|
||||
pkg_check_modules(PC_GSSAPI QUIET "mit-krb5-gssapi")
|
||||
endif()
|
||||
|
||||
find_path(GSSAPI_INCLUDE_DIRS
|
||||
|
@ -7,7 +7,7 @@ set(__gtk3_required_version "${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION}")
|
||||
if(__gtk3_required_version)
|
||||
set(__gtk3_required_version " >= ${__gtk3_required_version}")
|
||||
endif()
|
||||
pkg_check_modules(GTK3 "gtk+-3.0${__gtk3_required_version}" IMPORTED_TARGET)
|
||||
pkg_check_modules(GTK3 IMPORTED_TARGET "gtk+-3.0${__gtk3_required_version}")
|
||||
|
||||
if (NOT TARGET PkgConfig::GTK3)
|
||||
set(GTK3_FOUND 0)
|
||||
|
@ -13,7 +13,7 @@ endif()
|
||||
find_package(PkgConfig QUIET)
|
||||
|
||||
if(PkgConfig_FOUND)
|
||||
pkg_check_modules(Libb2 libb2 IMPORTED_TARGET)
|
||||
pkg_check_modules(Libb2 IMPORTED_TARGET "libb2")
|
||||
|
||||
if (TARGET PkgConfig::Libb2)
|
||||
add_library(Libb2::Libb2 INTERFACE IMPORTED)
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
|
||||
pkg_check_modules(Libproxy libproxy-1.0 IMPORTED_TARGET)
|
||||
pkg_check_modules(Libproxy IMPORTED_TARGET "libproxy-1.0")
|
||||
|
||||
if (NOT TARGET PkgConfig::Libproxy)
|
||||
set(Libproxy_FOUND 0)
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
|
||||
pkg_check_modules(Libsystemd libsystemd IMPORTED_TARGET)
|
||||
pkg_check_modules(Libsystemd IMPORTED_TARGET "libsystemd")
|
||||
|
||||
if (NOT TARGET PkgConfig::Libsystemd)
|
||||
set(Libsystemd_FOUND 0)
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
|
||||
pkg_check_modules(Libudev libudev IMPORTED_TARGET)
|
||||
pkg_check_modules(Libudev IMPORTED_TARGET "libudev")
|
||||
|
||||
if (NOT TARGET PkgConfig::Libudev)
|
||||
set(Libudev_FOUND 0)
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
|
||||
pkg_check_modules(Mtdev mtdev IMPORTED_TARGET)
|
||||
pkg_check_modules(Mtdev IMPORTED_TARGET "mtdev")
|
||||
|
||||
if (NOT TARGET PkgConfig::Mtdev)
|
||||
set(Mtdev_FOUND 0)
|
||||
|
@ -43,7 +43,7 @@ if(NOT DEFINED MySQL_ROOT)
|
||||
find_package(PkgConfig QUIET)
|
||||
endif()
|
||||
if(PkgConfig_FOUND AND NOT DEFINED MySQL_ROOT)
|
||||
pkg_check_modules(PC_MySQL QUIET mysqlclient)
|
||||
pkg_check_modules(PC_MySQL QUIET "mysqlclient")
|
||||
set(MySQL_include_dir_hints ${PC_MySQL_INCLUDEDIR})
|
||||
set(MySQL_library_hints ${PC_MySQL_LIBDIR})
|
||||
set(MySQL_library_hints_debug "")
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
|
||||
pkg_check_modules(Tslib tslib IMPORTED_TARGET)
|
||||
pkg_check_modules(Tslib IMPORTED_TARGET "tslib")
|
||||
|
||||
if (NOT TARGET PkgConfig::Tslib)
|
||||
set(Tslib_FOUND 0)
|
||||
|
@ -22,21 +22,21 @@ if (unofficial-brotli_FOUND)
|
||||
else()
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(libbrotlidec QUIET libbrotlidec IMPORTED_TARGET)
|
||||
pkg_check_modules(libbrotlidec QUIET IMPORTED_TARGET "libbrotlidec")
|
||||
if (libbrotlidec_FOUND)
|
||||
add_library(WrapBrotli::WrapBrotliDec INTERFACE IMPORTED)
|
||||
target_link_libraries(WrapBrotli::WrapBrotliDec INTERFACE PkgConfig::libbrotlidec)
|
||||
set(WrapBrotli_FOUND ON)
|
||||
endif()
|
||||
|
||||
pkg_check_modules(libbrotlienc QUIET libbrotlienc IMPORTED_TARGET)
|
||||
pkg_check_modules(libbrotlienc QUIET IMPORTED_TARGET "libbrotlienc")
|
||||
if (libbrotlienc_FOUND)
|
||||
add_library(WrapBrotli::WrapBrotliEnc INTERFACE IMPORTED)
|
||||
target_link_libraries(WrapBrotli::WrapBrotliEnc INTERFACE PkgConfig::libbrotlienc)
|
||||
set(WrapBrotli_FOUND ON)
|
||||
endif()
|
||||
|
||||
pkg_check_modules(libbrotlicommon QUIET libbrotlicommon IMPORTED_TARGET)
|
||||
pkg_check_modules(libbrotlicommon QUIET IMPORTED_TARGET "libbrotlicommon")
|
||||
if (libbrotlicommon_FOUND)
|
||||
add_library(WrapBrotli::WrapBrotliCommon INTERFACE IMPORTED)
|
||||
target_link_libraries(WrapBrotli::WrapBrotliCommon INTERFACE PkgConfig::libbrotlicommon)
|
||||
|
@ -32,7 +32,7 @@ endif()
|
||||
|
||||
if(__harfbuzz_broken_config_file OR NOT __harfbuzz_found)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_HARFBUZZ harfbuzz IMPORTED_TARGET)
|
||||
pkg_check_modules(PC_HARFBUZZ IMPORTED_TARGET "harfbuzz")
|
||||
if(PC_HARFBUZZ_FOUND)
|
||||
set(__harfbuzz_target_name "PkgConfig::PC_HARFBUZZ")
|
||||
set(__harfbuzz_find_include_dirs_hints
|
||||
|
@ -22,7 +22,7 @@ if(NOT __pcre2_found)
|
||||
list(PREPEND WrapSystemPCRE2_REQUIRED_VARS PCRE2_LIBRARIES PCRE2_INCLUDE_DIRS)
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_PCRE2 QUIET libpcre2-16)
|
||||
pkg_check_modules(PC_PCRE2 QUIET "libpcre2-16")
|
||||
|
||||
find_path(PCRE2_INCLUDE_DIRS
|
||||
NAMES pcre2.h
|
||||
|
@ -40,7 +40,7 @@ if(TARGET zstd::libzstd_static OR TARGET zstd::libzstd_shared)
|
||||
endif()
|
||||
else()
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_ZSTD QUIET libzstd)
|
||||
pkg_check_modules(PC_ZSTD QUIET "libzstd")
|
||||
|
||||
find_path(ZSTD_INCLUDE_DIRS
|
||||
NAMES zstd.h
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
|
||||
pkg_check_modules(XKB_COMMON_X11 "xkbcommon-x11>=0.4.1" IMPORTED_TARGET)
|
||||
pkg_check_modules(XKB_COMMON_X11 IMPORTED_TARGET "xkbcommon-x11>=0.4.1")
|
||||
|
||||
if (NOT TARGET PkgConfig::XKB_COMMON_X11)
|
||||
set(XKB_COMMON_X11_FOUND 0)
|
||||
|
@ -4,7 +4,7 @@
|
||||
find_package(PkgConfig QUIET)
|
||||
|
||||
if(NOT TARGET PkgConfig::XRender)
|
||||
pkg_check_modules(XRender xrender IMPORTED_TARGET)
|
||||
pkg_check_modules(XRender IMPORTED_TARGET "xrender")
|
||||
|
||||
if (NOT TARGET PkgConfig::XRender)
|
||||
set(XRender_FOUND 0)
|
||||
|
Loading…
Reference in New Issue
Block a user