[cmake] Locate PkgConfig module with find_package() instead of include(FindPkgConfig)

This is the contemporary way of including find modules and including the
find module this way avoids cmake errors in conjunction with
find_package_handle_standard_args().

Signed-off-by: Kimon Hoffmann <Kimon.Hoffmann@lawo.com>
This commit is contained in:
Kimon Hoffmann 2023-08-09 12:08:16 +02:00 committed by akallabeth
parent 988dcd49a3
commit 8ec4d20616
13 changed files with 7 additions and 13 deletions

View File

@ -80,7 +80,6 @@ include(CheckIncludeFiles)
include(CheckLibraryExists) include(CheckLibraryExists)
include(CheckSymbolExists) include(CheckSymbolExists)
include(CheckStructHasMember) include(CheckStructHasMember)
include(FindPkgConfig)
include(TestBigEndian) include(TestBigEndian)
include(FindFeature) include(FindFeature)

View File

@ -38,7 +38,6 @@ if (WITH_WEBVIEW)
${WEBKIT} ${WEBKIT}
) )
else() else()
include(FindPkgConfig)
find_package(PkgConfig REQUIRED) find_package(PkgConfig REQUIRED)
pkg_check_modules(WEBVIEW_GTK webkit2gtk-4.0 REQUIRED) pkg_check_modules(WEBVIEW_GTK webkit2gtk-4.0 REQUIRED)
include_directories(${WEBVIEW_GTK_INCLUDE_DIRS}) include_directories(${WEBVIEW_GTK_INCLUDE_DIRS})

View File

@ -49,7 +49,6 @@ endif()
option(WITH_FUSE "Build clipboard with FUSE file copy support" ${OPT_FUSE_DEFAULT}) option(WITH_FUSE "Build clipboard with FUSE file copy support" ${OPT_FUSE_DEFAULT})
if(WITH_FUSE) if(WITH_FUSE)
include(FindPkgConfig)
find_package(PkgConfig REQUIRED) find_package(PkgConfig REQUIRED)
pkg_check_modules(FUSE3 fuse3) pkg_check_modules(FUSE3 fuse3)

View File

@ -8,7 +8,7 @@
set(REQUIRED_AVCODEC_VERSION 0.8) set(REQUIRED_AVCODEC_VERSION 0.8)
set(REQUIRED_AVCODEC_API_VERSION 53.25.0) set(REQUIRED_AVCODEC_API_VERSION 53.25.0)
include(FindPkgConfig) find_package(PkgConfig)
if (PKG_CONFIG_FOUND) if (PKG_CONFIG_FOUND)
pkg_check_modules(AVCODEC libavcodec) pkg_check_modules(AVCODEC libavcodec)

View File

@ -167,7 +167,6 @@ endfunction()
# #
# * First search with pkg-config (prefer MIT over Heimdal) # * First search with pkg-config (prefer MIT over Heimdal)
# * Then try to find krb5-config (generic, krb5-config.mit and last krb5-config.heimdal) # * Then try to find krb5-config (generic, krb5-config.mit and last krb5-config.heimdal)
include(FindPkgConfig)
find_package(PkgConfig REQUIRED) find_package(PkgConfig REQUIRED)
if (KRB5_ROOT_CONFIG) if (KRB5_ROOT_CONFIG)

View File

@ -4,7 +4,7 @@
# PCSC_INCLUDE_DIRS - pcsc include directories # PCSC_INCLUDE_DIRS - pcsc include directories
# PCSC_LIBRARIES - libraries needed for linking # PCSC_LIBRARIES - libraries needed for linking
include(FindPkgConfig) find_package(PkgConfig)
if(PKG_CONFIG_FOUND) if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_PCSC QUIET libpcsclite) pkg_check_modules(PC_PCSC QUIET libpcsclite)

View File

@ -5,7 +5,7 @@
# PKCS11_INCLUDE_DIRS - combined include directories # PKCS11_INCLUDE_DIRS - combined include directories
# PKCS11_LIBRARIES - combined libraries to link # PKCS11_LIBRARIES - combined libraries to link
include(FindPkgConfig) find_package(PkgConfig)
if (PKG_CONFIG_FOUND) if (PKG_CONFIG_FOUND)
pkg_check_modules(PKCS11 libpkcs11-helper-1) pkg_check_modules(PKCS11 libpkcs11-helper-1)

View File

@ -1,5 +1,5 @@
include(FindPkgConfig) find_package(PkgConfig)
if(PKG_CONFIG_FOUND) if(PKG_CONFIG_FOUND)
pkg_check_modules(PULSE libpulse) pkg_check_modules(PULSE libpulse)

View File

@ -1,5 +1,5 @@
include(FindPkgConfig) find_package(PkgConfig)
if (PKG_CONFIG_FOUND) if (PKG_CONFIG_FOUND)
pkg_check_modules(SWScale libswscale) pkg_check_modules(SWScale libswscale)

View File

@ -25,7 +25,7 @@
# limitations under the License. # limitations under the License.
#============================================================================= #=============================================================================
include(FindPkgConfig) find_package(PkgConfig)
if(PKG_CONFIG_FOUND) if(PKG_CONFIG_FOUND)
pkg_check_modules(WAYLAND_SCANNER_PC wayland-scanner) pkg_check_modules(WAYLAND_SCANNER_PC wayland-scanner)

View File

@ -70,7 +70,6 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/)
include(CheckIncludeFiles) include(CheckIncludeFiles)
include(CheckLibraryExists) include(CheckLibraryExists)
include(CheckStructHasMember) include(CheckStructHasMember)
include(FindPkgConfig)
include(TestBigEndian) include(TestBigEndian)
# Check for cmake compatibility (enable/disable features) # Check for cmake compatibility (enable/disable features)

View File

@ -79,7 +79,7 @@ endif()
# Find required libraries # Find required libraries
if (UWAC_HAVE_PIXMAN_REGION) if (UWAC_HAVE_PIXMAN_REGION)
include(FindPkgConfig) find_package(PkgConfig REQUIRED)
pkg_check_modules(pixman REQUIRED pixman-1) pkg_check_modules(pixman REQUIRED pixman-1)
include_directories(${pixman_INCLUDE_DIRS}) include_directories(${pixman_INCLUDE_DIRS})
elseif (FREERDP_UNIFIED_BUILD) elseif (FREERDP_UNIFIED_BUILD)

View File

@ -101,7 +101,6 @@ include(CheckIncludeFiles)
include(CheckLibraryExists) include(CheckLibraryExists)
include(CheckSymbolExists) include(CheckSymbolExists)
include(CheckStructHasMember) include(CheckStructHasMember)
include(FindPkgConfig)
include(TestBigEndian) include(TestBigEndian)
# Include our extra modules # Include our extra modules