diff options
| -rw-r--r-- | externals/find-modules/FindOpus.cmake | 18 | ||||
| -rw-r--r-- | externals/find-modules/Findenet.cmake | 9 | ||||
| -rw-r--r-- | externals/find-modules/Findhttplib.cmake | 9 | ||||
| -rw-r--r-- | externals/find-modules/Findinih.cmake | 9 | ||||
| -rw-r--r-- | externals/find-modules/Findlz4.cmake | 28 | ||||
| -rw-r--r-- | externals/find-modules/Findzstd.cmake | 28 |
6 files changed, 49 insertions, 52 deletions
diff --git a/externals/find-modules/FindOpus.cmake b/externals/find-modules/FindOpus.cmake index b68a6046b..2ba515352 100644 --- a/externals/find-modules/FindOpus.cmake +++ b/externals/find-modules/FindOpus.cmake | |||
| @@ -1,19 +1,17 @@ | |||
| 1 | # SPDX-FileCopyrightText: 2022 yuzu Emulator Project | 1 | # SPDX-FileCopyrightText: 2022 yuzu Emulator Project |
| 2 | # SPDX-License-Identifier: GPL-2.0-or-later | 2 | # SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | find_package(PkgConfig) | 4 | find_package(PkgConfig QUIET) |
| 5 | |||
| 6 | if (PKG_CONFIG_FOUND) | 5 | if (PKG_CONFIG_FOUND) |
| 7 | pkg_search_module(opus IMPORTED_TARGET GLOBAL opus) | 6 | pkg_search_module(OPUS QUIET IMPORTED_TARGET opus) |
| 8 | if (opus_FOUND) | ||
| 9 | add_library(Opus::opus ALIAS PkgConfig::opus) | ||
| 10 | endif() | ||
| 11 | endif() | 7 | endif() |
| 12 | 8 | ||
| 13 | include(FindPackageHandleStandardArgs) | 9 | include(FindPackageHandleStandardArgs) |
| 14 | find_package_handle_standard_args(Opus | 10 | find_package_handle_standard_args(Opus |
| 15 | REQUIRED_VARS | 11 | REQUIRED_VARS OPUS_LINK_LIBRARIES |
| 16 | opus_LINK_LIBRARIES | 12 | VERSION_VAR OPUS_VERSION |
| 17 | opus_FOUND | ||
| 18 | VERSION_VAR opus_VERSION | ||
| 19 | ) | 13 | ) |
| 14 | |||
| 15 | if (Opus_FOUND AND NOT TARGET Opus::opus) | ||
| 16 | add_library(Opus::opus ALIAS PkgConfig::OPUS) | ||
| 17 | endif() | ||
diff --git a/externals/find-modules/Findenet.cmake b/externals/find-modules/Findenet.cmake index 663a2592f..6dae76f4c 100644 --- a/externals/find-modules/Findenet.cmake +++ b/externals/find-modules/Findenet.cmake | |||
| @@ -4,10 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | find_package(PkgConfig QUIET) | 5 | find_package(PkgConfig QUIET) |
| 6 | if (PKG_CONFIG_FOUND) | 6 | if (PKG_CONFIG_FOUND) |
| 7 | pkg_search_module(ENET QUIET IMPORTED_TARGET GLOBAL libenet) | 7 | pkg_search_module(ENET QUIET IMPORTED_TARGET libenet) |
| 8 | if (ENET_FOUND) | ||
| 9 | add_library(enet::enet ALIAS PkgConfig::ENET) | ||
| 10 | endif() | ||
| 11 | endif() | 8 | endif() |
| 12 | 9 | ||
| 13 | include(FindPackageHandleStandardArgs) | 10 | include(FindPackageHandleStandardArgs) |
| @@ -15,3 +12,7 @@ find_package_handle_standard_args(enet | |||
| 15 | REQUIRED_VARS ENET_LINK_LIBRARIES | 12 | REQUIRED_VARS ENET_LINK_LIBRARIES |
| 16 | VERSION_VAR ENET_VERSION | 13 | VERSION_VAR ENET_VERSION |
| 17 | ) | 14 | ) |
| 15 | |||
| 16 | if (enet_FOUND AND NOT TARGET enet::enet) | ||
| 17 | add_library(enet::enet ALIAS PkgConfig::ENET) | ||
| 18 | endif() | ||
diff --git a/externals/find-modules/Findhttplib.cmake b/externals/find-modules/Findhttplib.cmake index 56e92a637..b72bad076 100644 --- a/externals/find-modules/Findhttplib.cmake +++ b/externals/find-modules/Findhttplib.cmake | |||
| @@ -10,13 +10,14 @@ if (httplib_FOUND) | |||
| 10 | else() | 10 | else() |
| 11 | find_package(PkgConfig QUIET) | 11 | find_package(PkgConfig QUIET) |
| 12 | if (PKG_CONFIG_FOUND) | 12 | if (PKG_CONFIG_FOUND) |
| 13 | pkg_search_module(HTTPLIB QUIET IMPORTED_TARGET GLOBAL cpp-httplib) | 13 | pkg_search_module(HTTPLIB QUIET IMPORTED_TARGET cpp-httplib) |
| 14 | if (HTTPLIB_FOUND) | ||
| 15 | add_library(httplib::httplib ALIAS PkgConfig::HTTPLIB) | ||
| 16 | endif() | ||
| 17 | endif() | 14 | endif() |
| 18 | find_package_handle_standard_args(httplib | 15 | find_package_handle_standard_args(httplib |
| 19 | REQUIRED_VARS HTTPLIB_INCLUDEDIR | 16 | REQUIRED_VARS HTTPLIB_INCLUDEDIR |
| 20 | VERSION_VAR HTTPLIB_VERSION | 17 | VERSION_VAR HTTPLIB_VERSION |
| 21 | ) | 18 | ) |
| 22 | endif() | 19 | endif() |
| 20 | |||
| 21 | if (httplib_FOUND AND NOT TARGET httplib::httplib) | ||
| 22 | add_library(httplib::httplib ALIAS PkgConfig::HTTPLIB) | ||
| 23 | endif() | ||
diff --git a/externals/find-modules/Findinih.cmake b/externals/find-modules/Findinih.cmake index 844396471..8d1a07243 100644 --- a/externals/find-modules/Findinih.cmake +++ b/externals/find-modules/Findinih.cmake | |||
| @@ -4,10 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | find_package(PkgConfig QUIET) | 5 | find_package(PkgConfig QUIET) |
| 6 | if (PKG_CONFIG_FOUND) | 6 | if (PKG_CONFIG_FOUND) |
| 7 | pkg_search_module(INIREADER QUIET IMPORTED_TARGET GLOBAL INIReader) | 7 | pkg_search_module(INIREADER QUIET IMPORTED_TARGET INIReader) |
| 8 | if (INIREADER_FOUND) | ||
| 9 | add_library(inih::INIReader ALIAS PkgConfig::INIREADER) | ||
| 10 | endif() | ||
| 11 | endif() | 8 | endif() |
| 12 | 9 | ||
| 13 | include(FindPackageHandleStandardArgs) | 10 | include(FindPackageHandleStandardArgs) |
| @@ -15,3 +12,7 @@ find_package_handle_standard_args(inih | |||
| 15 | REQUIRED_VARS INIREADER_LINK_LIBRARIES | 12 | REQUIRED_VARS INIREADER_LINK_LIBRARIES |
| 16 | VERSION_VAR INIREADER_VERSION | 13 | VERSION_VAR INIREADER_VERSION |
| 17 | ) | 14 | ) |
| 15 | |||
| 16 | if (inih_FOUND AND NOT TARGET inih::INIReader) | ||
| 17 | add_library(inih::INIReader ALIAS PkgConfig::INIREADER) | ||
| 18 | endif() | ||
diff --git a/externals/find-modules/Findlz4.cmake b/externals/find-modules/Findlz4.cmake index a928c4307..f4c7005ba 100644 --- a/externals/find-modules/Findlz4.cmake +++ b/externals/find-modules/Findlz4.cmake | |||
| @@ -6,25 +6,23 @@ include(FindPackageHandleStandardArgs) | |||
| 6 | find_package(lz4 QUIET CONFIG) | 6 | find_package(lz4 QUIET CONFIG) |
| 7 | if (lz4_FOUND) | 7 | if (lz4_FOUND) |
| 8 | find_package_handle_standard_args(lz4 CONFIG_MODE) | 8 | find_package_handle_standard_args(lz4 CONFIG_MODE) |
| 9 | if (NOT TARGET lz4::lz4) | ||
| 10 | if (TARGET LZ4::lz4_shared) | ||
| 11 | set_target_properties(LZ4::lz4_shared PROPERTIES IMPORTED_GLOBAL TRUE) | ||
| 12 | add_library(lz4::lz4 ALIAS LZ4::lz4_shared) | ||
| 13 | else() | ||
| 14 | set_target_properties(LZ4::lz4_static PROPERTIES IMPORTED_GLOBAL TRUE) | ||
| 15 | add_library(lz4::lz4 ALIAS LZ4::lz4_static) | ||
| 16 | endif() | ||
| 17 | endif() | ||
| 18 | else() | 9 | else() |
| 19 | find_package(PkgConfig QUIET) | 10 | find_package(PkgConfig QUIET) |
| 20 | if (PKG_CONFIG_FOUND) | 11 | if (PKG_CONFIG_FOUND) |
| 21 | pkg_search_module(liblz4 QUIET IMPORTED_TARGET GLOBAL liblz4) | 12 | pkg_search_module(LZ4 QUIET IMPORTED_TARGET liblz4) |
| 22 | if (liblz4_FOUND) | ||
| 23 | add_library(lz4::lz4 ALIAS PkgConfig::liblz4) | ||
| 24 | endif() | ||
| 25 | endif() | 13 | endif() |
| 26 | find_package_handle_standard_args(lz4 | 14 | find_package_handle_standard_args(lz4 |
| 27 | REQUIRED_VARS liblz4_LINK_LIBRARIES | 15 | REQUIRED_VARS LZ4_LINK_LIBRARIES |
| 28 | VERSION_VAR liblz4_VERSION | 16 | VERSION_VAR LZ4_VERSION |
| 29 | ) | 17 | ) |
| 30 | endif() | 18 | endif() |
| 19 | |||
| 20 | if (lz4_FOUND AND NOT TARGET lz4::lz4) | ||
| 21 | if (TARGET LZ4::lz4_shared) | ||
| 22 | add_library(lz4::lz4 ALIAS LZ4::lz4_shared) | ||
| 23 | elseif (TARGET LZ4::lz4_static) | ||
| 24 | add_library(lz4::lz4 ALIAS LZ4::lz4_static) | ||
| 25 | else() | ||
| 26 | add_library(lz4::lz4 ALIAS PkgConfig::LZ4) | ||
| 27 | endif() | ||
| 28 | endif() | ||
diff --git a/externals/find-modules/Findzstd.cmake b/externals/find-modules/Findzstd.cmake index 1c29f3598..1aacc41d0 100644 --- a/externals/find-modules/Findzstd.cmake +++ b/externals/find-modules/Findzstd.cmake | |||
| @@ -6,25 +6,23 @@ include(FindPackageHandleStandardArgs) | |||
| 6 | find_package(zstd QUIET CONFIG) | 6 | find_package(zstd QUIET CONFIG) |
| 7 | if (zstd_FOUND) | 7 | if (zstd_FOUND) |
| 8 | find_package_handle_standard_args(zstd CONFIG_MODE) | 8 | find_package_handle_standard_args(zstd CONFIG_MODE) |
| 9 | if (NOT TARGET zstd::zstd) | ||
| 10 | if (TARGET zstd::libzstd_shared) | ||
| 11 | set_target_properties(zstd::libzstd_shared PROPERTIES IMPORTED_GLOBAL TRUE) | ||
| 12 | add_library(zstd::zstd ALIAS zstd::libzstd_shared) | ||
| 13 | else() | ||
| 14 | set_target_properties(zstd::libzstd_static PROPERTIES IMPORTED_GLOBAL TRUE) | ||
| 15 | add_library(zstd::zstd ALIAS zstd::libzstd_static) | ||
| 16 | endif() | ||
| 17 | endif() | ||
| 18 | else() | 9 | else() |
| 19 | find_package(PkgConfig QUIET) | 10 | find_package(PkgConfig QUIET) |
| 20 | if (PKG_CONFIG_FOUND) | 11 | if (PKG_CONFIG_FOUND) |
| 21 | pkg_search_module(libzstd QUIET IMPORTED_TARGET GLOBAL libzstd) | 12 | pkg_search_module(ZSTD QUIET IMPORTED_TARGET libzstd) |
| 22 | if (libzstd_FOUND) | ||
| 23 | add_library(zstd::zstd ALIAS PkgConfig::libzstd) | ||
| 24 | endif() | ||
| 25 | endif() | 13 | endif() |
| 26 | find_package_handle_standard_args(zstd | 14 | find_package_handle_standard_args(zstd |
| 27 | REQUIRED_VARS libzstd_LINK_LIBRARIES | 15 | REQUIRED_VARS ZSTD_LINK_LIBRARIES |
| 28 | VERSION_VAR libzstd_VERSION | 16 | VERSION_VAR ZSTD_VERSION |
| 29 | ) | 17 | ) |
| 30 | endif() | 18 | endif() |
| 19 | |||
| 20 | if (zstd_FOUND AND NOT TARGET zstd::zstd) | ||
| 21 | if (TARGET zstd::libzstd_shared) | ||
| 22 | add_library(zstd::zstd ALIAS zstd::libzstd_shared) | ||
| 23 | elseif (TARGET zstd::libzstd_static) | ||
| 24 | add_library(zstd::zstd ALIAS zstd::libzstd_static) | ||
| 25 | else() | ||
| 26 | add_library(zstd::zstd ALIAS PkgConfig::ZSTD) | ||
| 27 | endif() | ||
| 28 | endif() | ||