summaryrefslogtreecommitdiffstats
path: root/externals/find-modules
diff options
context:
space:
mode:
Diffstat (limited to 'externals/find-modules')
-rw-r--r--externals/find-modules/FindDiscordRPC.cmake27
-rw-r--r--externals/find-modules/Findenet.cmake17
-rw-r--r--externals/find-modules/Findhttplib.cmake22
-rw-r--r--externals/find-modules/Findinih.cmake17
-rw-r--r--externals/find-modules/Findlz4.cmake37
-rw-r--r--externals/find-modules/Findzstd.cmake37
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 @@
+# SPDX-FileCopyrightText: 2022 Alexandre Bouvier <contact@amb.tf>
+#
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+find_path(DiscordRPC_INCLUDE_DIR discord_rpc.h)
+
+find_library(DiscordRPC_LIBRARY discord-rpc)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(DiscordRPC
+ REQUIRED_VARS
+ DiscordRPC_LIBRARY
+ DiscordRPC_INCLUDE_DIR
+)
+
+if (DiscordRPC_FOUND AND NOT TARGET DiscordRPC::discord-rpc)
+ add_library(DiscordRPC::discord-rpc UNKNOWN IMPORTED)
+ set_target_properties(DiscordRPC::discord-rpc PROPERTIES
+ IMPORTED_LOCATION "${DiscordRPC_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES "${DiscordRPC_INCLUDE_DIR}"
+ )
+endif()
+
+mark_as_advanced(
+ DiscordRPC_INCLUDE_DIR
+ DiscordRPC_LIBRARY
+)
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 @@
+# SPDX-FileCopyrightText: 2022 Alexandre Bouvier <contact@amb.tf>
+#
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+find_package(PkgConfig QUIET)
+if (PKG_CONFIG_FOUND)
+ pkg_search_module(ENET QUIET IMPORTED_TARGET GLOBAL libenet)
+ if (ENET_FOUND)
+ add_library(enet::enet ALIAS PkgConfig::ENET)
+ endif()
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(enet
+ REQUIRED_VARS ENET_LINK_LIBRARIES
+ VERSION_VAR ENET_VERSION
+)
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 @@
+# SPDX-FileCopyrightText: 2022 Andrea Pappacoda <andrea@pappacoda.it>
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+include(FindPackageHandleStandardArgs)
+
+find_package(httplib QUIET CONFIG)
+if (httplib_FOUND)
+ find_package_handle_standard_args(httplib CONFIG_MODE)
+else()
+ find_package(PkgConfig QUIET)
+ if (PKG_CONFIG_FOUND)
+ pkg_search_module(HTTPLIB QUIET IMPORTED_TARGET GLOBAL cpp-httplib)
+ if (HTTPLIB_FOUND)
+ add_library(httplib::httplib ALIAS PkgConfig::HTTPLIB)
+ endif()
+ endif()
+ find_package_handle_standard_args(httplib
+ REQUIRED_VARS HTTPLIB_INCLUDEDIR
+ VERSION_VAR HTTPLIB_VERSION
+ )
+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 @@
+# SPDX-FileCopyrightText: 2022 Alexandre Bouvier <contact@amb.tf>
+#
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+find_package(PkgConfig QUIET)
+if (PKG_CONFIG_FOUND)
+ pkg_search_module(INIREADER QUIET IMPORTED_TARGET GLOBAL INIReader)
+ if (INIREADER_FOUND)
+ add_library(inih::INIReader ALIAS PkgConfig::INIREADER)
+ endif()
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(inih
+ REQUIRED_VARS INIREADER_LINK_LIBRARIES
+ VERSION_VAR INIREADER_VERSION
+)
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 @@
# SPDX-FileCopyrightText: 2022 yuzu Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
-find_package(PkgConfig)
+include(FindPackageHandleStandardArgs)
-if (PKG_CONFIG_FOUND)
- pkg_search_module(liblz4 IMPORTED_TARGET GLOBAL liblz4)
- if (liblz4_FOUND)
- add_library(lz4::lz4 ALIAS PkgConfig::liblz4)
+find_package(lz4 QUIET CONFIG)
+if (lz4_FOUND)
+ find_package_handle_standard_args(lz4 CONFIG_MODE)
+ if (NOT TARGET lz4::lz4)
+ if (TARGET LZ4::lz4_shared)
+ set_target_properties(LZ4::lz4_shared PROPERTIES IMPORTED_GLOBAL TRUE)
+ add_library(lz4::lz4 ALIAS LZ4::lz4_shared)
+ else()
+ set_target_properties(LZ4::lz4_static PROPERTIES IMPORTED_GLOBAL TRUE)
+ add_library(lz4::lz4 ALIAS LZ4::lz4_static)
+ endif()
+ endif()
+else()
+ find_package(PkgConfig QUIET)
+ if (PKG_CONFIG_FOUND)
+ pkg_search_module(liblz4 QUIET IMPORTED_TARGET GLOBAL liblz4)
+ if (liblz4_FOUND)
+ add_library(lz4::lz4 ALIAS PkgConfig::liblz4)
+ endif()
endif()
+ find_package_handle_standard_args(lz4
+ REQUIRED_VARS liblz4_LINK_LIBRARIES
+ VERSION_VAR liblz4_VERSION
+ )
endif()
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(lz4
- REQUIRED_VARS
- liblz4_LINK_LIBRARIES
- liblz4_FOUND
- VERSION_VAR liblz4_VERSION
-)
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 @@
# SPDX-FileCopyrightText: 2022 yuzu Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
-find_package(PkgConfig)
+include(FindPackageHandleStandardArgs)
-if (PKG_CONFIG_FOUND)
- pkg_search_module(libzstd IMPORTED_TARGET GLOBAL libzstd)
- if (libzstd_FOUND)
- add_library(zstd::zstd ALIAS PkgConfig::libzstd)
+find_package(zstd QUIET CONFIG)
+if (zstd_FOUND)
+ find_package_handle_standard_args(zstd CONFIG_MODE)
+ if (NOT TARGET zstd::zstd)
+ if (TARGET zstd::libzstd_shared)
+ set_target_properties(zstd::libzstd_shared PROPERTIES IMPORTED_GLOBAL TRUE)
+ add_library(zstd::zstd ALIAS zstd::libzstd_shared)
+ else()
+ set_target_properties(zstd::libzstd_static PROPERTIES IMPORTED_GLOBAL TRUE)
+ add_library(zstd::zstd ALIAS zstd::libzstd_static)
+ endif()
+ endif()
+else()
+ find_package(PkgConfig QUIET)
+ if (PKG_CONFIG_FOUND)
+ pkg_search_module(libzstd QUIET IMPORTED_TARGET GLOBAL libzstd)
+ if (libzstd_FOUND)
+ add_library(zstd::zstd ALIAS PkgConfig::libzstd)
+ endif()
endif()
+ find_package_handle_standard_args(zstd
+ REQUIRED_VARS libzstd_LINK_LIBRARIES
+ VERSION_VAR libzstd_VERSION
+ )
endif()
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(zstd
- REQUIRED_VARS
- libzstd_LINK_LIBRARIES
- libzstd_FOUND
- VERSION_VAR libzstd_VERSION
-)