diff options
Diffstat (limited to 'externals/find-modules')
| -rw-r--r-- | externals/find-modules/FindDiscordRPC.cmake | 27 | ||||
| -rw-r--r-- | externals/find-modules/Findenet.cmake | 17 | ||||
| -rw-r--r-- | externals/find-modules/Findhttplib.cmake | 22 | ||||
| -rw-r--r-- | externals/find-modules/Findinih.cmake | 17 | ||||
| -rw-r--r-- | externals/find-modules/Findlz4.cmake | 37 | ||||
| -rw-r--r-- | externals/find-modules/Findzstd.cmake | 37 |
6 files changed, 131 insertions, 26 deletions
diff --git a/externals/find-modules/FindDiscordRPC.cmake b/externals/find-modules/FindDiscordRPC.cmake new file mode 100644 index 000000000..44ca9904f --- /dev/null +++ b/externals/find-modules/FindDiscordRPC.cmake | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | # SPDX-FileCopyrightText: 2022 Alexandre Bouvier <contact@amb.tf> | ||
| 2 | # | ||
| 3 | # SPDX-License-Identifier: GPL-3.0-or-later | ||
| 4 | |||
| 5 | find_path(DiscordRPC_INCLUDE_DIR discord_rpc.h) | ||
| 6 | |||
| 7 | find_library(DiscordRPC_LIBRARY discord-rpc) | ||
| 8 | |||
| 9 | include(FindPackageHandleStandardArgs) | ||
| 10 | find_package_handle_standard_args(DiscordRPC | ||
| 11 | REQUIRED_VARS | ||
| 12 | DiscordRPC_LIBRARY | ||
| 13 | DiscordRPC_INCLUDE_DIR | ||
| 14 | ) | ||
| 15 | |||
| 16 | if (DiscordRPC_FOUND AND NOT TARGET DiscordRPC::discord-rpc) | ||
| 17 | add_library(DiscordRPC::discord-rpc UNKNOWN IMPORTED) | ||
| 18 | set_target_properties(DiscordRPC::discord-rpc PROPERTIES | ||
| 19 | IMPORTED_LOCATION "${DiscordRPC_LIBRARY}" | ||
| 20 | INTERFACE_INCLUDE_DIRECTORIES "${DiscordRPC_INCLUDE_DIR}" | ||
| 21 | ) | ||
| 22 | endif() | ||
| 23 | |||
| 24 | mark_as_advanced( | ||
| 25 | DiscordRPC_INCLUDE_DIR | ||
| 26 | DiscordRPC_LIBRARY | ||
| 27 | ) | ||
diff --git a/externals/find-modules/Findenet.cmake b/externals/find-modules/Findenet.cmake new file mode 100644 index 000000000..663a2592f --- /dev/null +++ b/externals/find-modules/Findenet.cmake | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | # SPDX-FileCopyrightText: 2022 Alexandre Bouvier <contact@amb.tf> | ||
| 2 | # | ||
| 3 | # SPDX-License-Identifier: GPL-3.0-or-later | ||
| 4 | |||
| 5 | find_package(PkgConfig QUIET) | ||
| 6 | if (PKG_CONFIG_FOUND) | ||
| 7 | pkg_search_module(ENET QUIET IMPORTED_TARGET GLOBAL libenet) | ||
| 8 | if (ENET_FOUND) | ||
| 9 | add_library(enet::enet ALIAS PkgConfig::ENET) | ||
| 10 | endif() | ||
| 11 | endif() | ||
| 12 | |||
| 13 | include(FindPackageHandleStandardArgs) | ||
| 14 | find_package_handle_standard_args(enet | ||
| 15 | REQUIRED_VARS ENET_LINK_LIBRARIES | ||
| 16 | VERSION_VAR ENET_VERSION | ||
| 17 | ) | ||
diff --git a/externals/find-modules/Findhttplib.cmake b/externals/find-modules/Findhttplib.cmake new file mode 100644 index 000000000..56e92a637 --- /dev/null +++ b/externals/find-modules/Findhttplib.cmake | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | # SPDX-FileCopyrightText: 2022 Andrea Pappacoda <andrea@pappacoda.it> | ||
| 2 | # | ||
| 3 | # SPDX-License-Identifier: GPL-2.0-or-later | ||
| 4 | |||
| 5 | include(FindPackageHandleStandardArgs) | ||
| 6 | |||
| 7 | find_package(httplib QUIET CONFIG) | ||
| 8 | if (httplib_FOUND) | ||
| 9 | find_package_handle_standard_args(httplib CONFIG_MODE) | ||
| 10 | else() | ||
| 11 | find_package(PkgConfig QUIET) | ||
| 12 | if (PKG_CONFIG_FOUND) | ||
| 13 | pkg_search_module(HTTPLIB QUIET IMPORTED_TARGET GLOBAL cpp-httplib) | ||
| 14 | if (HTTPLIB_FOUND) | ||
| 15 | add_library(httplib::httplib ALIAS PkgConfig::HTTPLIB) | ||
| 16 | endif() | ||
| 17 | endif() | ||
| 18 | find_package_handle_standard_args(httplib | ||
| 19 | REQUIRED_VARS HTTPLIB_INCLUDEDIR | ||
| 20 | VERSION_VAR HTTPLIB_VERSION | ||
| 21 | ) | ||
| 22 | endif() | ||
diff --git a/externals/find-modules/Findinih.cmake b/externals/find-modules/Findinih.cmake new file mode 100644 index 000000000..844396471 --- /dev/null +++ b/externals/find-modules/Findinih.cmake | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | # SPDX-FileCopyrightText: 2022 Alexandre Bouvier <contact@amb.tf> | ||
| 2 | # | ||
| 3 | # SPDX-License-Identifier: GPL-3.0-or-later | ||
| 4 | |||
| 5 | find_package(PkgConfig QUIET) | ||
| 6 | if (PKG_CONFIG_FOUND) | ||
| 7 | pkg_search_module(INIREADER QUIET IMPORTED_TARGET GLOBAL INIReader) | ||
| 8 | if (INIREADER_FOUND) | ||
| 9 | add_library(inih::INIReader ALIAS PkgConfig::INIREADER) | ||
| 10 | endif() | ||
| 11 | endif() | ||
| 12 | |||
| 13 | include(FindPackageHandleStandardArgs) | ||
| 14 | find_package_handle_standard_args(inih | ||
| 15 | REQUIRED_VARS INIREADER_LINK_LIBRARIES | ||
| 16 | VERSION_VAR INIREADER_VERSION | ||
| 17 | ) | ||
diff --git a/externals/find-modules/Findlz4.cmake b/externals/find-modules/Findlz4.cmake index 13ca5de66..a928c4307 100644 --- a/externals/find-modules/Findlz4.cmake +++ b/externals/find-modules/Findlz4.cmake | |||
| @@ -1,19 +1,30 @@ | |||
| 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 | include(FindPackageHandleStandardArgs) |
| 5 | 5 | ||
| 6 | if (PKG_CONFIG_FOUND) | 6 | find_package(lz4 QUIET CONFIG) |
| 7 | pkg_search_module(liblz4 IMPORTED_TARGET GLOBAL liblz4) | 7 | if (lz4_FOUND) |
| 8 | if (liblz4_FOUND) | 8 | find_package_handle_standard_args(lz4 CONFIG_MODE) |
| 9 | add_library(lz4::lz4 ALIAS PkgConfig::liblz4) | 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() | ||
| 19 | find_package(PkgConfig QUIET) | ||
| 20 | if (PKG_CONFIG_FOUND) | ||
| 21 | pkg_search_module(liblz4 QUIET IMPORTED_TARGET GLOBAL liblz4) | ||
| 22 | if (liblz4_FOUND) | ||
| 23 | add_library(lz4::lz4 ALIAS PkgConfig::liblz4) | ||
| 24 | endif() | ||
| 10 | endif() | 25 | endif() |
| 26 | find_package_handle_standard_args(lz4 | ||
| 27 | REQUIRED_VARS liblz4_LINK_LIBRARIES | ||
| 28 | VERSION_VAR liblz4_VERSION | ||
| 29 | ) | ||
| 11 | endif() | 30 | endif() |
| 12 | |||
| 13 | include(FindPackageHandleStandardArgs) | ||
| 14 | find_package_handle_standard_args(lz4 | ||
| 15 | REQUIRED_VARS | ||
| 16 | liblz4_LINK_LIBRARIES | ||
| 17 | liblz4_FOUND | ||
| 18 | VERSION_VAR liblz4_VERSION | ||
| 19 | ) | ||
diff --git a/externals/find-modules/Findzstd.cmake b/externals/find-modules/Findzstd.cmake index f4031eb70..1c29f3598 100644 --- a/externals/find-modules/Findzstd.cmake +++ b/externals/find-modules/Findzstd.cmake | |||
| @@ -1,19 +1,30 @@ | |||
| 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 | include(FindPackageHandleStandardArgs) |
| 5 | 5 | ||
| 6 | if (PKG_CONFIG_FOUND) | 6 | find_package(zstd QUIET CONFIG) |
| 7 | pkg_search_module(libzstd IMPORTED_TARGET GLOBAL libzstd) | 7 | if (zstd_FOUND) |
| 8 | if (libzstd_FOUND) | 8 | find_package_handle_standard_args(zstd CONFIG_MODE) |
| 9 | add_library(zstd::zstd ALIAS PkgConfig::libzstd) | 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() | ||
| 19 | find_package(PkgConfig QUIET) | ||
| 20 | if (PKG_CONFIG_FOUND) | ||
| 21 | pkg_search_module(libzstd QUIET IMPORTED_TARGET GLOBAL libzstd) | ||
| 22 | if (libzstd_FOUND) | ||
| 23 | add_library(zstd::zstd ALIAS PkgConfig::libzstd) | ||
| 24 | endif() | ||
| 10 | endif() | 25 | endif() |
| 26 | find_package_handle_standard_args(zstd | ||
| 27 | REQUIRED_VARS libzstd_LINK_LIBRARIES | ||
| 28 | VERSION_VAR libzstd_VERSION | ||
| 29 | ) | ||
| 11 | endif() | 30 | endif() |
| 12 | |||
| 13 | include(FindPackageHandleStandardArgs) | ||
| 14 | find_package_handle_standard_args(zstd | ||
| 15 | REQUIRED_VARS | ||
| 16 | libzstd_LINK_LIBRARIES | ||
| 17 | libzstd_FOUND | ||
| 18 | VERSION_VAR libzstd_VERSION | ||
| 19 | ) | ||