From 8ec4d20616cc6afa8c4dd6aaf2361ef731b72287 Mon Sep 17 00:00:00 2001 From: Kimon Hoffmann Date: Wed, 9 Aug 2023 12:08:16 +0200 Subject: [PATCH] [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 --- CMakeLists.txt | 1 - client/SDL/aad/CMakeLists.txt | 1 - client/common/CMakeLists.txt | 1 - cmake/FindFFmpeg.cmake | 2 +- cmake/FindKRB5.cmake | 1 - cmake/FindPCSC.cmake | 2 +- cmake/FindPkcs11.cmake | 2 +- cmake/FindPulse.cmake | 2 +- cmake/FindSWScale.cmake | 2 +- cmake/FindWayland.cmake | 2 +- rdtk/CMakeLists.txt | 1 - uwac/CMakeLists.txt | 2 +- winpr/CMakeLists.txt | 1 - 13 files changed, 7 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a5b62e8f1..2e2865273 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,7 +80,6 @@ include(CheckIncludeFiles) include(CheckLibraryExists) include(CheckSymbolExists) include(CheckStructHasMember) -include(FindPkgConfig) include(TestBigEndian) include(FindFeature) diff --git a/client/SDL/aad/CMakeLists.txt b/client/SDL/aad/CMakeLists.txt index c2b0620f0..3b553201d 100644 --- a/client/SDL/aad/CMakeLists.txt +++ b/client/SDL/aad/CMakeLists.txt @@ -38,7 +38,6 @@ if (WITH_WEBVIEW) ${WEBKIT} ) else() - include(FindPkgConfig) find_package(PkgConfig REQUIRED) pkg_check_modules(WEBVIEW_GTK webkit2gtk-4.0 REQUIRED) include_directories(${WEBVIEW_GTK_INCLUDE_DIRS}) diff --git a/client/common/CMakeLists.txt b/client/common/CMakeLists.txt index 322131dfe..2fa355ab5 100644 --- a/client/common/CMakeLists.txt +++ b/client/common/CMakeLists.txt @@ -49,7 +49,6 @@ endif() option(WITH_FUSE "Build clipboard with FUSE file copy support" ${OPT_FUSE_DEFAULT}) if(WITH_FUSE) - include(FindPkgConfig) find_package(PkgConfig REQUIRED) pkg_check_modules(FUSE3 fuse3) diff --git a/cmake/FindFFmpeg.cmake b/cmake/FindFFmpeg.cmake index ffa16412a..ef65af423 100644 --- a/cmake/FindFFmpeg.cmake +++ b/cmake/FindFFmpeg.cmake @@ -8,7 +8,7 @@ set(REQUIRED_AVCODEC_VERSION 0.8) set(REQUIRED_AVCODEC_API_VERSION 53.25.0) -include(FindPkgConfig) +find_package(PkgConfig) if (PKG_CONFIG_FOUND) pkg_check_modules(AVCODEC libavcodec) diff --git a/cmake/FindKRB5.cmake b/cmake/FindKRB5.cmake index eef19b34e..0b908c51d 100644 --- a/cmake/FindKRB5.cmake +++ b/cmake/FindKRB5.cmake @@ -167,7 +167,6 @@ endfunction() # # * First search with pkg-config (prefer MIT over Heimdal) # * Then try to find krb5-config (generic, krb5-config.mit and last krb5-config.heimdal) -include(FindPkgConfig) find_package(PkgConfig REQUIRED) if (KRB5_ROOT_CONFIG) diff --git a/cmake/FindPCSC.cmake b/cmake/FindPCSC.cmake index 16a59e8e3..e0272420c 100644 --- a/cmake/FindPCSC.cmake +++ b/cmake/FindPCSC.cmake @@ -4,7 +4,7 @@ # PCSC_INCLUDE_DIRS - pcsc include directories # PCSC_LIBRARIES - libraries needed for linking -include(FindPkgConfig) +find_package(PkgConfig) if(PKG_CONFIG_FOUND) pkg_check_modules(PC_PCSC QUIET libpcsclite) diff --git a/cmake/FindPkcs11.cmake b/cmake/FindPkcs11.cmake index c1d1b5201..bcfb2061b 100644 --- a/cmake/FindPkcs11.cmake +++ b/cmake/FindPkcs11.cmake @@ -5,7 +5,7 @@ # PKCS11_INCLUDE_DIRS - combined include directories # PKCS11_LIBRARIES - combined libraries to link -include(FindPkgConfig) +find_package(PkgConfig) if (PKG_CONFIG_FOUND) pkg_check_modules(PKCS11 libpkcs11-helper-1) diff --git a/cmake/FindPulse.cmake b/cmake/FindPulse.cmake index a53f71fdb..596641318 100644 --- a/cmake/FindPulse.cmake +++ b/cmake/FindPulse.cmake @@ -1,5 +1,5 @@ -include(FindPkgConfig) +find_package(PkgConfig) if(PKG_CONFIG_FOUND) pkg_check_modules(PULSE libpulse) diff --git a/cmake/FindSWScale.cmake b/cmake/FindSWScale.cmake index 57ef9ca7c..8ee9cc68b 100644 --- a/cmake/FindSWScale.cmake +++ b/cmake/FindSWScale.cmake @@ -1,5 +1,5 @@ -include(FindPkgConfig) +find_package(PkgConfig) if (PKG_CONFIG_FOUND) pkg_check_modules(SWScale libswscale) diff --git a/cmake/FindWayland.cmake b/cmake/FindWayland.cmake index e35173355..cfb6a865f 100644 --- a/cmake/FindWayland.cmake +++ b/cmake/FindWayland.cmake @@ -25,7 +25,7 @@ # limitations under the License. #============================================================================= -include(FindPkgConfig) +find_package(PkgConfig) if(PKG_CONFIG_FOUND) pkg_check_modules(WAYLAND_SCANNER_PC wayland-scanner) diff --git a/rdtk/CMakeLists.txt b/rdtk/CMakeLists.txt index ade385d2a..5a24c7069 100644 --- a/rdtk/CMakeLists.txt +++ b/rdtk/CMakeLists.txt @@ -70,7 +70,6 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/) include(CheckIncludeFiles) include(CheckLibraryExists) include(CheckStructHasMember) -include(FindPkgConfig) include(TestBigEndian) # Check for cmake compatibility (enable/disable features) diff --git a/uwac/CMakeLists.txt b/uwac/CMakeLists.txt index 4f82b6b74..4c98ccaa4 100644 --- a/uwac/CMakeLists.txt +++ b/uwac/CMakeLists.txt @@ -79,7 +79,7 @@ endif() # Find required libraries if (UWAC_HAVE_PIXMAN_REGION) - include(FindPkgConfig) + find_package(PkgConfig REQUIRED) pkg_check_modules(pixman REQUIRED pixman-1) include_directories(${pixman_INCLUDE_DIRS}) elseif (FREERDP_UNIFIED_BUILD) diff --git a/winpr/CMakeLists.txt b/winpr/CMakeLists.txt index 3c214bf49..a476445be 100644 --- a/winpr/CMakeLists.txt +++ b/winpr/CMakeLists.txt @@ -101,7 +101,6 @@ include(CheckIncludeFiles) include(CheckLibraryExists) include(CheckSymbolExists) include(CheckStructHasMember) -include(FindPkgConfig) include(TestBigEndian) # Include our extra modules