aboutsummaryrefslogtreecommitdiffhomepage
path: root/CMakeModules/Findgamemode.cmake
diff options
context:
space:
mode:
authorAlexandre Bouvier <[email protected]>2023-11-03 19:27:08 +0100
committerAlexandre Bouvier <[email protected]>2023-11-30 16:54:00 +0100
commitd2bb9e9729bbdeb396817c2335c4fafbf5ac94a2 (patch)
treef09b1f3a4c07ffdd1ba36ad6993a3220c5fbdf0b /CMakeModules/Findgamemode.cmake
parent127bfb81d5f03eb86f21053e6423083fec18d3fa (diff)
downloadyuzu-mainline-d2bb9e9729bbdeb396817c2335c4fafbf5ac94a2.tar.gz
yuzu-mainline-d2bb9e9729bbdeb396817c2335c4fafbf5ac94a2.zip
cmake: prefer system gamemode library
Diffstat (limited to 'CMakeModules/Findgamemode.cmake')
-rw-r--r--CMakeModules/Findgamemode.cmake15
1 files changed, 15 insertions, 0 deletions
diff --git a/CMakeModules/Findgamemode.cmake b/CMakeModules/Findgamemode.cmake
new file mode 100644
index 000000000..aa2f36683
--- /dev/null
+++ b/CMakeModules/Findgamemode.cmake
@@ -0,0 +1,15 @@
+# SPDX-FileCopyrightText: 2023 yuzu Emulator Project
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+find_package(PkgConfig QUIET)
+pkg_search_module(GAMEMODE QUIET IMPORTED_TARGET gamemode)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(gamemode
+ REQUIRED_VARS GAMEMODE_INCLUDEDIR
+ VERSION_VAR GAMEMODE_VERSION
+)
+
+if (gamemode_FOUND AND NOT TARGET gamemode::headers)
+ add_library(gamemode::headers ALIAS PkgConfig::GAMEMODE)
+endif()