Open gnif opened 1 year ago
Why are there changes needed to compile on Linux? In the GitHub actions it seems to compile on Linux without those changes.
Because your github actions are building against the OBS studio source from upstream directly rather then the packaged version that is distributed with Debian/Ubuntu using the libobs-dev packages.
The norm is to make use of pkg-config
to obtain the linker and compiler flags, which is what these changes do. Each distro provides their own header packages which contain the configuration for pkg-config making this distro agnostic.
Without these changes, attempting to build against the packaged version results in the following:
CMake Error at CMakeLists.txt:27 (find_package):
By not providing "Findlibobs.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "libobs", but
CMake did not find one.
Could not find a package configuration file provided by "libobs" with any
of the following names:
libobsConfig.cmake
libobs-config.cmake
Add the installation prefix of "libobs" to CMAKE_PREFIX_PATH or set
"libobs_DIR" to a directory containing one of the above files. If "libobs"
provides a separate development package or SDK, be sure it has been
installed.
-- Configuring incomplete, errors occurred!
See also "/home/geoff/Projects/LG/obs-dynamic-delay/CMakeFiles/CMakeOutput.log".
make: *** [Makefile:299: cmake_check_build_system] Error 1
as for the version ifdef, OBS_TEXT_INFO
does not exist before v28
Further to this it would be nice too if the CMake install target was by default for the local user, installing into ~/.config/obs-studio/plugins/dynamic-delay
making it available without needing to run make install
as root.
ie:
-- Install configuration: "RelWithDebInfo"
-- Installing: /home/geoff/.config/obs-studio/plugins/dynamic-delay/bin/64bit/dynamic-delay.so
-- Installing: /home/geoff/.config/obs-studio/plugins/dynamic-delay/data//locale
-- Installing: /home/geoff/.config/obs-studio/plugins/dynamic-delay/data//locale/en-US.ini
-- Installing: /home/geoff/.config/obs-studio/plugins/dynamic-delay/obs-plugins/64bit/dynamic-delay.so
-- Installing: /home/geoff/.config/obs-studio/plugins/dynamic-delay/data/obs-plugins/dynamic-delay
-- Installing: /home/geoff/.config/obs-studio/plugins/dynamic-delay/data/obs-plugins/dynamic-delay/locale
-- Installing: /home/geoff/.config/obs-studio/plugins/dynamic-delay/data/obs-plugins/dynamic-delay/locale/en-US.ini
obviously it can be done with cmake defines by setting the install prefix and out dirs manually, but it would be a nice default to have if the install target is run as an unprivileged user.
If you would like a working example, we are doing this here for the Looking Glass project: https://github.com/gnif/LookingGlass/blob/master/obs/CMakeLists.txt#L33:L48 https://github.com/gnif/LookingGlass/blob/master/obs/CMakeLists.txt#L86:L88
Not tested on other operating systems however the following changes are needed to be made to make this work in a reliable way on Linux.