Commit Graph

38 Commits

Author SHA1 Message Date
PatTheMav
3e7fbf69a7 cmake: Update buildspec system to use preset file
Updates code for dependency management to use "vendor" information from
the CMake preset file.
2026-01-12 11:18:05 -05:00
PatTheMav
4625dda66d cmake: Apply gersemi 0.25 formatting 2026-01-09 15:47:12 -05:00
PatTheMav
07176822ad cmake: Enable interprocedural optimization for Release configuration
The built-in CMake variable will set the appropriate compiler flags
for supported compilers and compiler versions.
2025-08-22 15:12:55 -04:00
tytan652
2bd23cd50d libobs,cmake: Replace vendored SIMD Everywhere by prefix/system install
SIMD Everywhere finder needs to be installed alongside libobs CMake
package since its headers depends on it.

C++ cmath header is included on Windows on ARM to ensure that all math
functions are correctly defined when included in C++ code.
https://github.com/simd-everywhere/simde/issues/1304

macOS intrinsics is included to make sure that no redefinition error
happens.
2025-08-21 15:22:08 -04:00
PatTheMav
4c912358a9 cmake: Remove enforced architectures for macOS builds
Ideally CMAKE_OSX_ARCHITECTURES should not be set automatically within
the project but should exclusively be a cache or environment variable
provided by the developer.

This would also match the requirement mentioned by the CMake
documentation that the value should be set before the first project()
call.

If this variable is not set, the Xcode generator would default to the
native platform of the host, but the buildspec system as well as the
"add_obs_plugin" function need a local "architecture" to work, so
use "CMAKE_HOST_SYSTEM_PROCESSOR" instead if CMAKE_OSX_ARCHITECTURES
was not provided.
2025-08-19 17:59:22 -04:00
PatTheMav
ab01c406c2 cmake: Update formatting introduced by gersemi 0.21.0 2025-08-01 19:02:04 +02:00
PatTheMav
4f2d752fa7 cmake: Remove outdated and incorrect code comment in osconfig module 2025-08-01 19:02:04 +02:00
PatTheMav
6c590805e8 cmake: Update supported CMake version range to 3.28 and 3.30 2024-09-13 14:42:32 -04:00
PatTheMav
cfc12d0543 cmake: Disable CCache for local builds and enable by default for CI 2024-09-12 17:45:29 -04:00
tytan652
31385006d5 Remove legacy_check CMake macro
The macro was not removed in 72428ccd97
waiting for submodules to be be updated to a commit where their legacy
code path is removed.
2024-09-11 13:24:39 -04:00
PatTheMav
d81fcd70e0 cmake: Update cross-platform build project management for Windows
Enables creation of x64 and x86 child projects when building on ARM64
and decouples functionality from legacy_check function
2024-08-20 16:00:21 -04:00
PatTheMav
c89cef3aa5 cmake: Fix malformed CMake package location on Windows
CMake doesn't expect CMake package files to be separated in
subdirectories on Windows and instead expects all files to be put in
a single directory `cmake` found within one of the PREFIX paths.

Also fixes circular dependency in w32-pthreads CMake package config
file.
2024-08-20 14:48:08 -04:00
PatTheMav
b8cfacaec3 Update formatting of CMake files 2024-08-14 12:07:47 -04:00
tytan652
8480660bf8 cmake: Add architecture support to add_obs_plugin
Also add formatting support to the function
2024-07-29 18:11:29 -04:00
Kamal Mostafa
d813b7837a cmake: Do not write build number file if OBS_BUILD_NUMBER set
Allows for configuration and build from a read-only-mounted source dir
by setting the build number externally. For example:
`cmake -DOBS_BUILD_NUMBER=1`
2024-05-28 14:33:44 -04:00
Ryan Foster
649c62cfac cmake: Remove more Qt 5 code
Qt Gui virtualkeyboard plugin was removed in Qt 6.x.
Qt Network Bearer Management was removed in Qt 6.0.
Qt Multimedia mediaservice and audio plugins were removed in Qt 6.x.
2024-04-30 12:02:26 -04:00
Ryan Foster
8a7ad10262 cmake: Remove find_qt macro
We no longer need this functionality in the new CMake paths. It is still
available in the legacy CMake path.
2024-04-17 21:52:14 -04:00
PatTheMav
e77b12820f cmake: Add Linux component to CMake build framework 3.0 2024-04-13 23:48:38 -04:00
Aleks Todorov
80ad63a6da cmake: Provide a clear error on version check fail
Currently, when git describe fails to get a git tag for the OBS Version,
a non-fatal message is printed, and the generator is left to continue,
usually ending up with a more cryptic error message down the line.

Instead, print the git output together with a short description of what
actually happened, and exit fatally so the problematic line of code is
clear. An added advantage is that the git output is printed in red
instead of (say) white on color-enabled terminals.
2024-04-04 15:13:43 -04:00
PatTheMav
eae4673071 cmake: Update CMake formatting with manual format choices 2023-12-19 17:59:44 -05:00
PatTheMav
8135085a23 cmake: Replace custom Qt discovery function with CMake default
find_qt was necessary during the transitional period between Qt5 and
Qt6. With Qt6 being the only supported Qt version (for open source) for
the time being, code complexity can be reduced for easier maintenance.
2023-12-19 17:59:44 -05:00
PatTheMav
cc387d7b66 cmake: Use dependency hashes to track revisions
Store and read dependency hashes to determine if a dependency needs to
have its extracted copy replaced (e.g., a dependency that had its
revision changed but not its version changed).
2023-10-09 16:49:29 -04:00
derrod
e11ffeccb0 cmake/libobs: Only set beta/rc increment 2023-10-06 17:21:51 -06:00
PatTheMav
b3949e6aef cmake: Update qrcodegen finder to match target names of CMake package
qrcodegen is built on obs-deps for macOS and Windows, with the
generated CMake package calling the dependency qrcodegen (not
libqrcoden) and associated target qrcodegen::qrcodegen.

This change updates the finder (required for Linux) to create the same
targets so consumers do not need to differentiate between different
variations of the same dependency on Linux.

Also updates obs-websocket to 5.3.1 to bring in associated CMake
changes.
2023-09-27 18:05:02 -04:00
PatTheMav
00d6f0b26e cmake: Fix regular expression for beta and RC version detection 2023-09-10 10:12:13 +10:00
derrod
4c51c99d28 cmake: Parse beta/rc version from override/git describe 2023-08-19 17:12:50 +02:00
gxalpha
9d611a064f cmake: Remove Qt version selection and Qt 5 support 2023-07-19 11:56:54 -04:00
derrod
8d33da1fab cmake: Disable char8_t when using C++20 2023-07-05 09:39:41 -07:00
PatTheMav
850976eba9 cmake: Add Windows component to CMake build framework 3.0 2023-06-29 10:11:32 -04:00
PatTheMav
eb3d9963a0 cmake: Update macOS compiler configuration
Compiler extensions are disabled before the first `project` call to
force CMake into considering compilers to not support GNU extensions
(even though clang and gcc do).

Also sets common clang compiler options so they can be used across all
supported platforms.

`openmp-simd` support is enabled by default as there is no performance
penalty on x86_64 systems and intrinsics are enabled on arm64.

Also implements CMake's `CMAKE_COMPILE_WARNING_AS_ERROR` flag to
enable the desired behavior and configuration time.
2023-06-17 12:23:33 -04:00
PatTheMav
e2e3c9e102 cmake: Fix CMake policy scopes and add include guards
Include guards ensure that bootstrap includes happen only once for the
entire project. Moving all policy changes into an included file without
its own policy scope ensures that the policy is applied to the project.
2023-06-17 12:23:33 -04:00
PatTheMav
887b537d56 cmake: Update buildspec and presets for macOS 2023-06-17 12:23:33 -04:00
Lain
106c7aa61f Update copyrights/names 2023-05-20 01:31:18 -07:00
PatTheMav
df4c8d21ad cmake: Remove generated libobs export header from install interface 2023-04-12 17:17:00 +00:00
PatTheMav
3bfaf6661b cmake: Fix parsing of OBS_VERSION_OVERRIDE cache variable 2023-04-07 21:11:37 +02:00
derrod
8a2305fd9a cmake: Fix parsing BETA version cache variable 2023-04-07 20:59:30 +02:00
gxalpha
712a6c3b33 cmake: Ignore all Qt darwin permission plugins 2023-03-27 16:08:22 -04:00
PatTheMav
ae6e9c875b cmake: Add OBS CMake build framework 3.0
OBS CMake build framework 3.0 is a minor overhaul of version 2.0. Due
to close proximity of the 2.0 rework, the amount of actual changes to
project files are minimal and mostly concern application generation.

This commit contains the bootstrap elements only and requires
OS-specific implementations to be functional.
2023-03-26 18:20:38 -04:00