CMake seems to set either `CMAKE_OSX_ARCHITECTURES` and
`CMAKE_OSX_DEPLOYMENT_TARGET` implicitly to empty cache variables when
not defined explicitly on the commandline or via a GUI.
Setting a default thus requires the `FORCE` flag to overwrite these
empty defaults with our desired results. The branches ensure that user-
provided non-empty values are not overwritten as well.
- Headers are now installed per default on Linux.
- `obs-hevc.h` is not installed if HEVC is disabled.
- OS exclusive headers are no longer installed on the wrong OS.
Soon to be updated obs-deps built on CI will retain CMake package files
created while building dependencies. When CMake uses packages, the usual
triplet of variables from finders are not set. `CopyMSVCBins` relies
on one such variable.
This PR sets the `CURL_INCLUDE_DIR` if the cURL target is present, but
apparently imported as a CMake package, to ensure prior functionality is
restored.
PIPEWIRE_DEFINITIONS contains ready-to-use compile flags. If used with
INTERFACE_COMPILE_DEFINITIONS, this can lead to a compile error.
Rename the variable to PIPEWIRE_COMPILE_FLAGS to be clear about that and
prevent accidental misuse.
If WAYLAND_DEFINITIONS is set to "-I/usr/include/wayland", setting its
value as INTERFACE_COMPILE_DEFINITION leads to CMake emitting
"-D-I/usr/include/wayland" in the compiler flags. This breaks the
compilation of targets that call find_package(Wayland), such as libobs
and libobs-opengl, in gcc.
To avoid this, rename WAYLAND_DEFINITIONS to WAYLAND_COMPILE_FLAGS to
reflect that it contains ready-to-use compiler flags. Use
WAYLAND_COMPILE_FLAGS as INTERFACE_COMPILE_OPTIONS so it just gets
appended without adding the superfluous "-D".
Makes the check for the number of plugins in the global list an explicit
length check (not relying on CMake implicit functionality), also moves
it in line with how the same was solved in `ObsHelpers.cmake` globally.
The `add_target_resource` function uses unnecessary path components
when copying files to the rundir, resulting in files added that way
not to end up where OBS expects them to.
The generated binaries created by sub-targets also need to be copied
as part of `win-capture`'s data files, which was easy to fix as the
target exists before CMake switches into the subdirectories.
When using `install`, CMake will fix up a binary's rpath entries
automatically. As `install` is also used to copy all build artifacts
into a common runtime directory, this will lead to independent binaries
such as "obs-ffmpeg-mux" to be fixed up to run within a fully portable
app bundle.
Yet during development, the app bundle is not fully portable, so rpath
entries to e.g. libobs need to be retained. Using CMake's
`install PROGRAMS` variant will achieve just that.
Status output related to OBS configuration is prefixed with the string
"OBS" and added padding for enabled and disabled features. This padding
was not aligned between platforms.
By moving the padding and prefix decoration into its own function,
both elements are controlled in a single place. CMake scripts were
changed to use this new function `obs_status` instead of using CMake's
`message` function directly.
obs-plugintemplate uses the `obs_libraries` component to install
obs components required for plugin development. The need of the separate
`pdbs` directory was removed a while ago (as PDB target installation
can be flagged as `OPTIONAL` and enabled for specific configurations
only). This part was overlooked in that change.
Windows and Linux do not require a contained application bundle to run
and debug OBS - as such targets can and should be copied independently
from the main OBS application target.
Also silences the output of the `install` step that sets up those files.
Users on Wayland are displeased that they cannot see their hotkey
bindings. This enables key reporting like X11, and has the infrastructure
in place in case Wayland ever decides to allow for capturing input.
* aja: Initial commit of AJA capture/output plugin
* aja: Fix clang-format on aja-output-ui code
* aja: Remove script used during dev/testing
* aja: Address pull request feedback from @RytoEX
* aja: Remove the SDK sources and update CMakeLists to point to new headers-only/static libs dependency distribution.
* aja: Only build AJA plugin on x64 on macOS for now
* aja: Remove the non-English placeholder locale files. The english strings/files will be produced via crowdin, according to @ddrboxman.
* aja: Add FindLibAJANTV2.cmake script to locate the ajantv2 headers and static libs in the OBS external deps package(s). Tested on Windows x64. macOS and Linux x64 TBD.
* aja: Add ajantv2/includes to FindLibAJANTV2 include search paths
* aja: Remove commented code from aja CMakeLists
* aja: Remove debug code and comments that are no longer needed.
* aja: Fix indentation
* aja: Remove disablement of clang-format in routing table and SDIWireFormat map
* aja: Use spaces for all indentation in widget crosspoint arrays where we disable clang-format
* aja: Address code style comments made by @RytoEX
* aja: Fix uneven indentation
* aja: More fixes to if/else placement and remove superfluous comments.
* aja: Rename 'dwns' to 'deactivateWhileNotShowing' for clarity. The DeckLink plugin still uses the variable name 'dwns' and should be changed, if desired, in a separate PR.
* aja: Remove X11Extras dependency from AJA Output frontend plugin
* aja: Add patch from Jim to find AJA release/debug libs
* aja: Improve AV sync of queued video/audio sent to the AJA card in the AJA Output plugin.
We require libdrm for its header so add the cmake module and header path
to the build. We don't need to link libdrm though so we dont add it to
libraries.
During CMake configuration for 64-bit builds, CopyMSVCBins.cmake would
copy plugins/imageformats/qsvg.dll from the Qt directory to
additional_install_files/exec64r/imageformats/qsvg.dll (exec32r for
32-bit builds). However, it would copy plugins/iconengines/qsvgicond.dll
to the corresponding debug imageformats files location,
additional_install_files/exec64d/imageformats/qsvgicond.dll (or exec32d
for 32-bit). This appears to have been a simple copy-paste mistake.
Let's copy plugins/imageformats/qsvgd.dll instead.
These local copies of CheckForPthreads.c and FindThreads.cmake override
the ones included with CMake. These versions create CMake::Threads, but
Qt6 expects Threads::Threads created by CMake 3.1+. These local versions
seem to be based on old copies from CMake from late 2014 with some
customizations. Let's just use the built-in ones that CMake ships.
This commit also changes CMakeLists.txt files in UI and libobs to
require and link to Threads::Threads.
Co-authored-by: Kurt Kartaltepe <kkartaltepe@gmail.com>
Since CMake 3.17, find_package_handle_standard_args (FPHSA) will emit a
warning if the package name in the caller and in FPHSA do not match.
This normalizes the name "Detours" in CMake calls to prevent this
warning.
FindJack was not using _INCLUDE_DIRS and _LIBRARY_DIRS set by
FindPkgConfig, which prevented it from locating the PipeWire
version of libjack when it is installed to a non-standard path.
In particular, this impacts Fedora Linux, which is the first
distribution to have made the change to have all audio routed
through PipeWire and eliminate the usage of PulseAudio and JACK
by default.
Reference: https://fedoraproject.org/wiki/Changes/DefaultPipeWire
These files have been superseded by files in CI/scripts/macos. They are
no longer used, and keeping them around creates confusion and makes
people think they are still used. Let's remove them to prevent further
confusion.
This commit also removes the CMake function `obs_finish_bundle` that was
only used with the osxbundle resources and removes calls to that
function.
Helps ensure DLLs associated with game capture, virtual camera, and
other such files have their PDBs copied alongside them in any Windows
build, and allows the ability to trace crashes that may occur from
within those files more easily.
If someone tries to build without git they need to set
OBS_VERSION_OVERRIDE, this makes the error message occur before things
like string parsing on the OBS_VERSION which look like missing
parameters.
Add a new Linux capture based on PipeWire [1] and the Desktop portal [2].
This new capture starts by asking the Desktop portal for a screencapture session.
There are quite a few D-Bus calls involved in this, but the key points are:
1. A connection to org.freedesktop.portal.ScreenCast is estabilished, and the
available cursor modes are updated.
2. CreateSession() is called. This is the first step of the negotiation.
3. SelectSources() is called. This is when a system dialog pops up asking the
user to either select a monitor (desktop capture) or a window (window capture).
4. Start() is called. This signals the compositor that it can setup a PipeWire
stream, and start sending buffers.
The reply to this fourth call gives OBS Studio the PipeWire fd, and the id of the
PipeWire node where the buffers are being sent to. This allows creating a consumer
PipeWire stream, and receive the buffers.
Metadata cursor is always preferred, but on the lack of it, we ask the stream for
an embedded cursor (i.e. the cursor is drawn at the buffer, and OBS Studio has no
control over it.)
Window capturing is implemented as a crop operation on the buffer. Compositors
can send big buffers, and a crop rectangle, and this is used to paint a subregion
of the buffer in the scene.
The new capture is only loaded when running on EGL, since it depends on EGL to
call gs_texture_create_from_dmabuf().
[1] https://pipewire.org/
[2] https://github.com/flatpak/xdg-desktop-portal/
GDBus is more and better maintained than libdbus these days. In the
future, a potential Wayland-compatible capture plugin will need to
interact with D-Bus in a way that's way too complicated for libdbus,
and it won't be nice to have both libraries talking to the D-Bus
socket.
Replace the libdbus usage by GDBus. As it turns out, it results in less
code.