-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: falkTX <[email protected]>
- Loading branch information
Showing
21 changed files
with
3,502 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
cmake_minimum_required(VERSION 3.16...3.25) | ||
|
||
legacy_check() | ||
|
||
option(ENABLE_CARLA "Enable building OBS with carla plugin host" ON) | ||
if(NOT ENABLE_CARLA) | ||
target_disable(carla) | ||
return() | ||
endif() | ||
|
||
# Find Qt | ||
find_qt(COMPONENTS Core Widgets) | ||
|
||
# Use pkg-config to find optional deps | ||
find_package(PkgConfig) | ||
|
||
# Find pthread via cmake | ||
if(OS_WINDOWS) | ||
set(carla_pthread_libs OBS::w32-pthreads) | ||
else() | ||
find_package(Threads REQUIRED) | ||
set(carla_pthread_libs ${CMAKE_THREAD_LIBS_INIT}) | ||
endif() | ||
|
||
# Optional: transient X11 window flags | ||
if(PKGCONFIG_FOUND AND NOT (OS_MACOS OR OS_WINDOWS)) | ||
pkg_check_modules(X11 "x11") | ||
else() | ||
set(X11_FOUND FALSE) | ||
endif() | ||
|
||
# Use *.mm files under macOS, regular *.cpp everywhere else | ||
if(OS_MACOS) | ||
set(CARLA_OBJCPP_EXT "mm") | ||
else() | ||
set(CARLA_OBJCPP_EXT "cpp") | ||
endif() | ||
|
||
# Import extra carla libs | ||
include(cmake/jackbridge.cmake) | ||
add_library(carla::jackbridge ALIAS carla-jackbridge) | ||
|
||
include(cmake/lilv.cmake) | ||
add_library(carla::lilv ALIAS carla-lilv) | ||
|
||
include(cmake/rtmempool.cmake) | ||
add_library(carla::rtmempool ALIAS carla-rtmempool) | ||
|
||
include(cmake/water.cmake) | ||
add_library(carla::water ALIAS carla-water) | ||
|
||
# Setup binary tools | ||
include(cmake/carla-discovery-native.cmake) | ||
include(cmake/carla-bridge-native.cmake) | ||
|
||
# Setup carla-bridge target | ||
add_library(carla-bridge MODULE) | ||
add_library(OBS::carla-bridge ALIAS carla-bridge) | ||
|
||
target_compile_definitions( | ||
carla-bridge | ||
PRIVATE BUILDING_CARLA | ||
BUILDING_CARLA_OBS | ||
CARLA_BACKEND_NAMESPACE=CarlaBridgeOBS | ||
CARLA_FRONTEND_NO_CACHED_PLUGIN_API | ||
CARLA_MODULE_ID="carla-bridge" | ||
CARLA_MODULE_NAME="Carla Bridge" | ||
CARLA_PLUGIN_ONLY_BRIDGE | ||
STATIC_PLUGIN_TARGET) | ||
|
||
target_include_directories( | ||
carla-bridge | ||
PRIVATE carla/source | ||
carla/source/backend | ||
carla/source/frontend | ||
carla/source/frontend/utils | ||
carla/source/includes | ||
carla/source/modules | ||
carla/source/utils) | ||
|
||
# TODO remove carla::water dependency from PluginDiscovery.cpp | ||
|
||
target_link_libraries(carla-bridge PRIVATE carla::jackbridge carla::lilv carla::water OBS::libobs Qt::Core Qt::Widgets) | ||
|
||
if(NOT (OS_MACOS OR OS_WINDOWS)) | ||
target_link_options(carla-bridge PRIVATE -Wl,--no-undefined) | ||
endif() | ||
|
||
target_sources( | ||
carla-bridge | ||
PRIVATE carla.c | ||
carla-bridge.cpp | ||
carla-bridge-wrapper.cpp | ||
common.c | ||
qtutils.cpp | ||
carla/source/backend/utils/Information.cpp | ||
carla/source/backend/utils/PluginDiscovery.cpp | ||
carla/source/frontend/carla_frontend.cpp | ||
carla/source/frontend/pluginlist/pluginlistdialog.cpp | ||
carla/source/frontend/pluginlist/pluginlistrefreshdialog.cpp | ||
carla/source/utils/CarlaBridgeUtils.cpp | ||
carla/source/utils/CarlaMacUtils.${CARLA_OBJCPP_EXT} | ||
carla/source/utils/CarlaPipeUtils.cpp) | ||
|
||
set_target_properties_obs( | ||
carla-bridge | ||
PROPERTIES AUTOMOC ON | ||
AUTOUIC ON | ||
AUTORCC ON | ||
FOLDER plugins | ||
PREFIX "") |
Oops, something went wrong.