11cmake_minimum_required (VERSION 3.16 )
2- project (obs-auto-cam-switcher VERSION 1.0.0)
2+ project (podswitch VERSION 1.0.0)
33set (CMAKE_CXX_STANDARD 17)
44set (CMAKE_CXX_STANDARD_REQUIRED ON )
55
@@ -11,32 +11,35 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
1111# -DOBS_SOURCE_DIR=/path/to/obs-studio
1212# We include our bundled src/obs-config.h stub so no OBS cmake build needed.
1313# ---------------------------------------------------------------------------
14- set (OBS_SOURCE_DIR "" CACHE PATH "obs-studio source tree" )
14+ # ---------------------------------------------------------------------------
15+ # OBS Studio - Forced Header-Only Build (Option B)
16+ # ---------------------------------------------------------------------------
17+ if (NOT OBS_SOURCE_DIR )
18+ set (OBS_SOURCE_DIR "/Users/philybarrolaza/Library/Mobile Documents/com~apple~CloudDocs/Projects/Podswitch/.deps/obs-studio-31.1.1" CACHE PATH "obs-studio source tree" FORCE )
19+ endif ()
1520
16- if (OBS_SOURCE_DIR )
17- message (STATUS "[switchy] Building against OBS source headers: ${OBS_SOURCE_DIR } " )
21+ set (OBS_CONFIG_DIR "/Users/philybarrolaza/Library/Mobile Documents/com~apple~CloudDocs/Projects/Podswitch/.deps/obs-studio-31.1.1/build_universal/config" )
1822
19- add_library (OBS::libobs INTERFACE IMPORTED )
20- target_include_directories (OBS::libobs INTERFACE
21- "${OBS_SOURCE_DIR } /libobs" # obs.h, obs-module.h, obs-data.h, blog.h …
22- "${OBS_SOURCE_DIR } " # fallback root
23- "${CMAKE_SOURCE_DIR } /src" # our bundled obs-config.h stub lives here
24- )
23+ message (STATUS "[podswitch] Using dependencies from: ${OBS_SOURCE_DIR } " )
2524
26- add_library (OBS::obs-frontend-api INTERFACE IMPORTED )
27- target_include_directories (OBS::obs-frontend-api INTERFACE
28- "${OBS_SOURCE_DIR } /UI/obs-frontend-api "
29- "${OBS_SOURCE_DIR } /libobs "
30- "${CMAKE_SOURCE_DIR } /src"
31- )
25+ add_library (OBS::libobs INTERFACE IMPORTED )
26+ target_include_directories (OBS::libobs INTERFACE
27+ "${OBS_SOURCE_DIR } /libobs "
28+ "${OBS_CONFIG_DIR} "
29+ "${CMAKE_SOURCE_DIR } /src" # our bundled obs-config.h stub lives here
30+ )
3231
33- # Plugin resolves OBS symbols at load time — no link-time OBS libs needed
34- set (OBS_SKIP_LINK TRUE )
32+ add_library (OBS::obs-frontend-api INTERFACE IMPORTED )
33+ target_include_directories (OBS::obs-frontend-api INTERFACE
34+ "${OBS_SOURCE_DIR } /frontend/api"
35+ "${OBS_SOURCE_DIR } /libobs"
36+ "${OBS_CONFIG_DIR} "
37+ "${CMAKE_SOURCE_DIR } /src"
38+ )
39+
40+ # Plugin resolves OBS symbols at load time — no link-time OBS libs needed
41+ set (OBS_SKIP_LINK TRUE )
3542
36- else ()
37- find_package (libobs REQUIRED )
38- find_package (obs-frontend-api REQUIRED )
39- endif ()
4043
4144# ---------------------------------------------------------------------------
4245# Qt (Qt6 → Qt5 → headless)
4952 if (Qt5_FOUND)
5053 set (QT_NS Qt5)
5154 else ()
52- message (WARNING "[switchy ] Qt not found — building headless (no UI)" )
55+ message (WARNING "[podswitch ] Qt not found — building headless (no UI)" )
5356 set (QT_NS "" )
5457 endif ()
5558endif ()
@@ -60,6 +63,15 @@ if(QT_NS)
6063 set (CMAKE_AUTORCC ON )
6164endif ()
6265
66+ # Robust macOS Sequoia Patch: Strip missing AGL framework from link lines
67+ if (APPLE )
68+ macro (target_link_libraries _target )
69+ set (_all_args ${ARGN} )
70+ list (REMOVE_ITEM _all_args "-framework AGL" )
71+ _target_link_libraries (${_target} ${_all_args} )
72+ endmacro ()
73+ endif ()
74+
6375# ---------------------------------------------------------------------------
6476# Sources
6577# ---------------------------------------------------------------------------
@@ -74,32 +86,33 @@ if(QT_NS)
7486 list (APPEND SRCS src/ui/dock-widget.cpp src/ui/settings-dialog.cpp)
7587endif ()
7688
77- add_library (obs-auto-cam-switcher MODULE ${SRCS} )
78- target_include_directories (obs-auto-cam-switcher PRIVATE src src/ui )
79- target_link_libraries (obs-auto-cam-switcher PRIVATE OBS::libobs OBS::obs-frontend-api )
89+ add_library (podswitch MODULE ${SRCS} )
90+ target_include_directories (podswitch PRIVATE src src/ui )
91+ target_link_libraries (podswitch PRIVATE OBS::libobs OBS::obs-frontend-api )
8092if (QT_NS)
81- target_link_libraries (obs-auto-cam-switcher PRIVATE ${QT_NS} ::Core ${QT_NS} ::Widgets )
93+ target_link_libraries (podswitch PRIVATE ${QT_NS} ::Core ${QT_NS} ::Widgets )
8294endif ()
83- set_target_properties (obs-auto-cam-switcher PROPERTIES PREFIX "" )
95+ set_target_properties (podswitch PROPERTIES PREFIX "" )
8496
8597# Runtime-link OBS symbols (resolved at plugin load time by OBS)
8698if (OBS_SKIP_LINK)
8799 if (APPLE )
88- target_link_options (obs-auto-cam-switcher PRIVATE -undefined dynamic_lookup )
100+ target_link_options (podswitch PRIVATE -undefined dynamic_lookup )
89101 elseif (UNIX )
90- target_link_options (obs-auto-cam-switcher PRIVATE -Wl,--allow-shlib-undefined )
102+ target_link_options (podswitch PRIVATE -Wl,--allow-shlib-undefined )
91103 endif ()
92104endif ()
93105
94106# ---------------------------------------------------------------------------
95107# Install
96108# ---------------------------------------------------------------------------
97109if (APPLE )
98- set (_PLUG "$ENV{HOME} /Library/Application Support/obs-studio/plugins/obs-auto-cam-switcher " )
110+ set (_PLUG "$ENV{HOME} /Library/Application Support/obs-studio/plugins/podswitch.plugin " )
99111elseif (WIN32 )
100- set (_PLUG "$ENV{APPDATA} /obs-studio/plugins/obs-auto-cam-switcher " )
112+ set (_PLUG "$ENV{APPDATA} /obs-studio/plugins/podswitch " )
101113else ()
102- set (_PLUG "$ENV{HOME} /.config/obs-studio/plugins/obs-auto-cam-switcher " )
114+ set (_PLUG "$ENV{HOME} /.config/obs-studio/plugins/podswitch " )
103115endif ()
104- install (TARGETS obs-auto-cam-switcher LIBRARY DESTINATION "${_PLUG} /bin/64bit" )
105- install (DIRECTORY data/ DESTINATION "${_PLUG} /data" )
116+ install (TARGETS podswitch LIBRARY DESTINATION "${_PLUG} /Contents/MacOS" )
117+ install (DIRECTORY data/ DESTINATION "${_PLUG} /Contents/Resources" )
118+
0 commit comments