summaryrefslogtreecommitdiff
path: root/externals/find-modules/Findopus.cmake
diff options
context:
space:
mode:
authorGravatar James Rowe2020-05-08 15:09:29 -0600
committerGravatar GitHub2020-05-08 17:09:29 -0400
commitbc30a591ba7252e0c16d9c1b3c75a7073735bcae (patch)
tree2e88ab16d60c7df3e665bcf7c75c24683cb07189 /externals/find-modules/Findopus.cmake
parentMerge pull request #3885 from ReinUsesLisp/viewport-swizzles (diff)
downloadyuzu-bc30a591ba7252e0c16d9c1b3c75a7073735bcae.tar.gz
yuzu-bc30a591ba7252e0c16d9c1b3c75a7073735bcae.tar.xz
yuzu-bc30a591ba7252e0c16d9c1b3c75a7073735bcae.zip
Replace externals with Conan (#3735)
* Remove git submodules that will be loaded through conan * Move custom Find modules to their own folder * Use conan for downloading missing external dependencies * CI: Change the yuzu source folder user to the user that the containers run on * Attempt to remove dirty mingw build hack * Install conan on the msvc build * Only set release build type when using not using multi config generator * Re-add qt bundled to workaround an issue with conan qt not downloading prebuilt binaries * Add workaround for submodules that use legacy CMAKE variables * Re-add USE_BUNDLED_QT on the msvc build bot
Diffstat (limited to 'externals/find-modules/Findopus.cmake')
-rw-r--r--externals/find-modules/Findopus.cmake42
1 files changed, 42 insertions, 0 deletions
diff --git a/externals/find-modules/Findopus.cmake b/externals/find-modules/Findopus.cmake
new file mode 100644
index 000000000..de84bd995
--- /dev/null
+++ b/externals/find-modules/Findopus.cmake
@@ -0,0 +1,42 @@
1
2find_package(PkgConfig QUIET)
3pkg_check_modules(PC_opus QUIET opus)
4
5find_path(opus_INCLUDE_DIR
6 NAMES opus.h
7 PATHS ${PC_opus_INCLUDE_DIRS}
8 PATH_SUFFIXES opus
9)
10find_library(opus_LIBRARY
11 NAMES opus
12 PATHS ${PC_opus_LIBRARY_DIRS}
13)
14
15include(FindPackageHandleStandardArgs)
16find_package_handle_standard_args(opus
17 FOUND_VAR opus_FOUND
18 REQUIRED_VARS
19 opus_LIBRARY
20 opus_INCLUDE_DIR
21 VERSION_VAR opus_VERSION
22)
23
24if(opus_FOUND)
25 set(Opus_LIBRARIES ${opus_LIBRARY})
26 set(Opus_INCLUDE_DIRS ${opus_INCLUDE_DIR})
27 set(Opus_DEFINITIONS ${PC_opus_CFLAGS_OTHER})
28endif()
29
30if(opus_FOUND AND NOT TARGET Opus::Opus)
31 add_library(Opus::Opus UNKNOWN IMPORTED)
32 set_target_properties(Opus::Opus PROPERTIES
33 IMPORTED_LOCATION "${opus_LIBRARY}"
34 INTERFACE_COMPILE_OPTIONS "${PC_opus_CFLAGS_OTHER}"
35 INTERFACE_INCLUDE_DIRECTORIES "${opus_INCLUDE_DIR}"
36 )
37endif()
38
39mark_as_advanced(
40 opus_INCLUDE_DIR
41 opus_LIBRARY
42)