Changeset View
Changeset View
Standalone View
Standalone View
cmake/modules/FindPipeWire.cmake
Show All 26 Lines | |||||
27 | # | 27 | # | ||
28 | # In general we recommend using the imported target, as it is easier to use. | 28 | # In general we recommend using the imported target, as it is easier to use. | ||
29 | # Bear in mind, however, that if the target is in the link interface of an | 29 | # Bear in mind, however, that if the target is in the link interface of an | ||
30 | # exported library, it must be made available by the package config file. | 30 | # exported library, it must be made available by the package config file. | ||
31 | 31 | | |||
32 | #============================================================================= | 32 | #============================================================================= | ||
33 | # Copyright 2014 Alex Merry <alex.merry@kde.org> | 33 | # Copyright 2014 Alex Merry <alex.merry@kde.org> | ||
34 | # Copyright 2014 Martin Gräßlin <mgraesslin@kde.org> | 34 | # Copyright 2014 Martin Gräßlin <mgraesslin@kde.org> | ||
35 | # Copyright 2018 Jan Grulich <jgrulich@redhat.com> | 35 | # Copyright 2018-2020 Jan Grulich <jgrulich@redhat.com> | ||
36 | # | 36 | # | ||
37 | # Redistribution and use in source and binary forms, with or without | 37 | # Redistribution and use in source and binary forms, with or without | ||
38 | # modification, are permitted provided that the following conditions | 38 | # modification, are permitted provided that the following conditions | ||
39 | # are met: | 39 | # are met: | ||
40 | # | 40 | # | ||
41 | # 1. Redistributions of source code must retain the copyright | 41 | # 1. Redistributions of source code must retain the copyright | ||
42 | # notice, this list of conditions and the following disclaimer. | 42 | # notice, this list of conditions and the following disclaimer. | ||
43 | # 2. Redistributions in binary form must reproduce the copyright | 43 | # 2. Redistributions in binary form must reproduce the copyright | ||
Show All 12 Lines | |||||
56 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 56 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
57 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 57 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
58 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 58 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
59 | #============================================================================= | 59 | #============================================================================= | ||
60 | 60 | | |||
61 | # Use pkg-config to get the directories and then use these values | 61 | # Use pkg-config to get the directories and then use these values | ||
62 | # in the FIND_PATH() and FIND_LIBRARY() calls | 62 | # in the FIND_PATH() and FIND_LIBRARY() calls | ||
63 | find_package(PkgConfig QUIET) | 63 | find_package(PkgConfig QUIET) | ||
64 | pkg_check_modules(PKG_PipeWire QUIET libpipewire-0.2 libpipewire-0.3) | | |||
65 | 64 | | |||
66 | set(PipeWire_DEFINITIONS "${PKG_PipeWire_CFLAGS_OTHER}") | 65 | pkg_search_module(PKG_PipeWire QUIET libpipewire-0.3 libpipewire-0.2) | ||
66 | pkg_search_module(PKG_Spa QUIET libspa-0.2 libspa-0.1) | ||||
67 | | ||||
68 | set(PipeWire_DEFINITIONS "${PKG_PipeWire_CFLAGS}" "${PKG_Spa_CFLAGS}") | ||||
67 | set(PipeWire_VERSION "${PKG_PipeWire_VERSION}") | 69 | set(PipeWire_VERSION "${PKG_PipeWire_VERSION}") | ||
68 | 70 | | |||
69 | find_path(PipeWire_INCLUDE_DIRS | 71 | find_path(PipeWire_INCLUDE_DIRS | ||
70 | NAMES | 72 | NAMES | ||
73 | pipewire-0.3/pipewire/pipewire.h | ||||
krop: this would break includes | |||||
74 | spa-0.2/spa/param/props.h | ||||
krop: same thing for this one | |||||
75 | # Old PipeWire locations | ||||
71 | pipewire/pipewire.h | 76 | pipewire/pipewire.h | ||
77 | spa/param/props.h | ||||
krop: That's still the current way to include it | |||||
72 | HINTS | 78 | HINTS | ||
73 | ${PKG_PipeWire_INCLUDE_DIRS} | 79 | ${PKG_PipeWire_INCLUDE_DIRS} | ||
80 | ${PKG_Spa_INCLUDE_DIRS} | ||||
Use: ${PKG_PipeWire_INCLUDE_DIRS} ${PKG_PipeWire_INCLUDE_DIRS}/pipewire-0.3 instead. krop: Use:
```
${PKG_PipeWire_INCLUDE_DIRS}
${PKG_PipeWire_INCLUDE_DIRS}/pipewire-0.3
```
instead. | |||||
krop: ```
${PKG_Spa_INCLUDE_DIRS}
${PKG_Spa_INCLUDE_DIRS}/spa-0.2
``` | |||||
74 | ) | 81 | ) | ||
75 | 82 | | |||
76 | find_library(PipeWire_LIBRARIES | 83 | find_library(PipeWire_LIBRARIES | ||
77 | NAMES | 84 | NAMES | ||
78 | pipewire-0.2 pipewire-0.3 | 85 | pipewire-0.3 | ||
86 | pipewire-0.2 | ||||
79 | HINTS | 87 | HINTS | ||
80 | ${PKG_PipeWire_LIBRARIES_DIRS} | 88 | ${PKG_PipeWire_LIBRARY_DIRS} | ||
81 | ) | 89 | ) | ||
82 | 90 | | |||
83 | include(FindPackageHandleStandardArgs) | 91 | include(FindPackageHandleStandardArgs) | ||
84 | find_package_handle_standard_args(PipeWire | 92 | find_package_handle_standard_args(PipeWire | ||
85 | FOUND_VAR | 93 | FOUND_VAR | ||
86 | PipeWire_FOUND | 94 | PipeWire_FOUND | ||
87 | REQUIRED_VARS | 95 | REQUIRED_VARS | ||
88 | PipeWire_LIBRARIES | 96 | PipeWire_LIBRARIES | ||
89 | PipeWire_INCLUDE_DIRS | 97 | PipeWire_INCLUDE_DIRS | ||
90 | VERSION_VAR | 98 | VERSION_VAR | ||
91 | PipeWire_VERSION | 99 | PipeWire_VERSION | ||
92 | ) | 100 | ) | ||
93 | 101 | | |||
94 | if(PipeWire_FOUND AND NOT TARGET PipeWire::PipeWire) | 102 | if(PipeWire_FOUND AND NOT TARGET PipeWire::PipeWire) | ||
95 | add_library(PipeWire::PipeWire UNKNOWN IMPORTED) | 103 | add_library(PipeWire::PipeWire UNKNOWN IMPORTED) | ||
96 | set_target_properties(PipeWire::PipeWire PROPERTIES | 104 | set_target_properties(PipeWire::PipeWire PROPERTIES | ||
97 | IMPORTED_LOCATION "${PipeWire_LIBRARIES}" | 105 | IMPORTED_LOCATION "${PipeWire_LIBRARIES}" | ||
98 | INTERFACE_COMPILE_OPTIONS "${PipeWire_DEFINITIONS}" | 106 | INTERFACE_COMPILE_OPTIONS "${PipeWire_DEFINITIONS}" | ||
99 | INTERFACE_INCLUDE_DIRECTORIES "${PipeWire_INCLUDE_DIRS}" | 107 | INTERFACE_INCLUDE_DIRECTORIES "${PipeWire_INCLUDE_DIRS}" | ||
krop: INTERFACE_INCLUDE_DIRECTORIES "${PipeWire_INCLUDE_DIRS};${Spa_INCLUDE_DIRS}" | |||||
100 | ) | 108 | ) | ||
101 | endif() | 109 | endif() | ||
102 | 110 | | |||
103 | mark_as_advanced(PipeWire_LIBRARIES PipeWire_INCLUDE_DIRS) | 111 | mark_as_advanced(PipeWire_LIBRARIES PipeWire_INCLUDE_DIRS) | ||
104 | 112 | | |||
105 | include(FeatureSummary) | 113 | include(FeatureSummary) | ||
106 | set_package_properties(PipeWire PROPERTIES | 114 | set_package_properties(PipeWire PROPERTIES | ||
107 | URL "https://www.pipewire.org" | 115 | URL "https://www.pipewire.org" | ||
108 | DESCRIPTION "PipeWire - multimedia processing" | 116 | DESCRIPTION "PipeWire - multimedia processing" | ||
109 | ) | 117 | ) |
this would break includes