mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-21 04:37:09 +08:00
Update formatting of CMake files
This commit is contained in:
@@ -21,10 +21,8 @@ legacy_check()
|
||||
|
||||
option(ENABLE_COMPAT_UPDATES "Checks for capture compatibility data updates" ON)
|
||||
|
||||
# cmake-format: off
|
||||
set(COMPAT_URL "https://obsproject.com/obs2_update/win-capture" CACHE STRING "Default services package URL")
|
||||
mark_as_advanced(COMPAT_URL)
|
||||
# cmake-format: on
|
||||
|
||||
if(NOT TARGET OBS::ipc-util)
|
||||
add_subdirectory("${CMAKE_SOURCE_DIR}/shared/ipc-util" "${CMAKE_BINARY_DIR}/shared/ipc-util")
|
||||
@@ -41,50 +39,55 @@ add_library(OBS::capture ALIAS win-capture)
|
||||
|
||||
target_sources(
|
||||
win-capture
|
||||
PRIVATE # cmake-format: sortable
|
||||
app-helpers.c
|
||||
app-helpers.h
|
||||
audio-helpers.c
|
||||
audio-helpers.h
|
||||
compat-format-ver.h
|
||||
compat-helpers.c
|
||||
compat-helpers.h
|
||||
cursor-capture.c
|
||||
cursor-capture.h
|
||||
dc-capture.c
|
||||
dc-capture.h
|
||||
duplicator-monitor-capture.c
|
||||
game-capture-file-init.c
|
||||
game-capture.c
|
||||
load-graphics-offsets.c
|
||||
monitor-capture.c
|
||||
nt-stuff.c
|
||||
nt-stuff.h
|
||||
plugin-main.c
|
||||
window-capture.c)
|
||||
PRIVATE
|
||||
app-helpers.c
|
||||
app-helpers.h
|
||||
audio-helpers.c
|
||||
audio-helpers.h
|
||||
compat-format-ver.h
|
||||
compat-helpers.c
|
||||
compat-helpers.h
|
||||
cursor-capture.c
|
||||
cursor-capture.h
|
||||
dc-capture.c
|
||||
dc-capture.h
|
||||
duplicator-monitor-capture.c
|
||||
game-capture-file-init.c
|
||||
game-capture.c
|
||||
load-graphics-offsets.c
|
||||
monitor-capture.c
|
||||
nt-stuff.c
|
||||
nt-stuff.h
|
||||
plugin-main.c
|
||||
window-capture.c
|
||||
)
|
||||
|
||||
target_compile_definitions(
|
||||
win-capture PRIVATE COMPAT_URL="${COMPAT_URL}" "$<$<BOOL:${ENABLE_COMPAT_UPDATES}>:ENABLE_COMPAT_UPDATES>"
|
||||
OBS_VERSION="${OBS_VERSION_CANONICAL}")
|
||||
win-capture
|
||||
PRIVATE
|
||||
COMPAT_URL="${COMPAT_URL}"
|
||||
"$<$<BOOL:${ENABLE_COMPAT_UPDATES}>:ENABLE_COMPAT_UPDATES>"
|
||||
OBS_VERSION="${OBS_VERSION_CANONICAL}"
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
win-capture
|
||||
PRIVATE OBS::file-updater
|
||||
OBS::hook-config
|
||||
OBS::inject-library
|
||||
OBS::ipc-util
|
||||
OBS::libobs
|
||||
OBS::obfuscate
|
||||
OBS::w32-pthreads
|
||||
OBS::winrt-headers
|
||||
jansson::jansson)
|
||||
PRIVATE
|
||||
OBS::file-updater
|
||||
OBS::hook-config
|
||||
OBS::inject-library
|
||||
OBS::ipc-util
|
||||
OBS::libobs
|
||||
OBS::obfuscate
|
||||
OBS::w32-pthreads
|
||||
OBS::winrt-headers
|
||||
jansson::jansson
|
||||
)
|
||||
|
||||
# Remove once jansson has been fixed on obs-deps
|
||||
target_link_options(win-capture PRIVATE /IGNORE:4098)
|
||||
|
||||
# cmake-format: off
|
||||
set_target_properties_obs(win-capture PROPERTIES FOLDER plugins/win-capture PREFIX "")
|
||||
# cmake-format: on
|
||||
|
||||
add_subdirectory(graphics-hook)
|
||||
add_subdirectory(get-graphics-offsets)
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
cmake_minimum_required(VERSION 3.24...3.25)
|
||||
|
||||
add_library(_get-graphics-offsets INTERFACE)
|
||||
target_sources(_get-graphics-offsets INTERFACE d3d8-offsets.cpp d3d9-offsets.cpp dxgi-offsets.cpp
|
||||
get-graphics-offsets.c get-graphics-offsets.h)
|
||||
target_sources(
|
||||
_get-graphics-offsets
|
||||
INTERFACE d3d8-offsets.cpp d3d9-offsets.cpp dxgi-offsets.cpp get-graphics-offsets.c get-graphics-offsets.h
|
||||
)
|
||||
|
||||
target_link_libraries(_get-graphics-offsets INTERFACE OBS::hook-config OBS::d3d8-api d3d9.lib dxgi.lib d3d11.lib)
|
||||
target_link_libraries(
|
||||
_get-graphics-offsets
|
||||
INTERFACE OBS::hook-config OBS::d3d8-api d3d9.lib dxgi.lib d3d11.lib
|
||||
)
|
||||
|
||||
legacy_check()
|
||||
|
||||
@@ -13,8 +18,6 @@ target_link_libraries(get-graphics-offsets PRIVATE _get-graphics-offsets)
|
||||
|
||||
include(cmake/32bit.cmake)
|
||||
|
||||
# cmake-format: off
|
||||
set_target_properties_obs(get-graphics-offsets PROPERTIES FOLDER plugins/win-capture OUTPUT_NAME get-graphics-offsets64 MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
# cmake-format: on
|
||||
|
||||
add_dependencies(win-capture get-graphics-offsets)
|
||||
|
||||
@@ -3,6 +3,7 @@ project(get-graphics-offsets)
|
||||
add_executable(get-graphics-offsets)
|
||||
target_link_libraries(get-graphics-offsets PRIVATE _get-graphics-offsets)
|
||||
|
||||
# cmake-format: off
|
||||
set_target_properties(get-graphics-offsets PROPERTIES OUTPUT_NAME get-graphics-offsets32 MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
# cmake-format: on
|
||||
set_target_properties(
|
||||
get-graphics-offsets
|
||||
PROPERTIES OUTPUT_NAME get-graphics-offsets32 MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>"
|
||||
)
|
||||
|
||||
@@ -2,4 +2,5 @@ add_custom_command(
|
||||
TARGET get-graphics-offsets
|
||||
POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_SOURCE_DIR}/build_x86 --config $<CONFIG> -t get-graphics-offsets
|
||||
COMMENT "Build 32-bit get-graphics-offsets")
|
||||
COMMENT "Build 32-bit get-graphics-offsets"
|
||||
)
|
||||
|
||||
@@ -15,24 +15,27 @@ add_library(_graphics-hook INTERFACE)
|
||||
|
||||
target_sources(
|
||||
_graphics-hook
|
||||
INTERFACE # cmake-format: sortable
|
||||
d3d10-capture.cpp
|
||||
d3d11-capture.cpp
|
||||
d3d12-capture.cpp
|
||||
d3d8-capture.cpp
|
||||
d3d9-capture.cpp
|
||||
d3d9-patches.hpp
|
||||
dxgi-capture.cpp
|
||||
gl-capture.c
|
||||
gl-decs.h
|
||||
graphics-hook.c
|
||||
graphics-hook.h
|
||||
graphics-hook.rc)
|
||||
INTERFACE
|
||||
d3d10-capture.cpp
|
||||
d3d11-capture.cpp
|
||||
d3d12-capture.cpp
|
||||
d3d8-capture.cpp
|
||||
d3d9-capture.cpp
|
||||
d3d9-patches.hpp
|
||||
dxgi-capture.cpp
|
||||
gl-capture.c
|
||||
gl-decs.h
|
||||
graphics-hook.c
|
||||
graphics-hook.h
|
||||
graphics-hook.rc
|
||||
)
|
||||
|
||||
target_compile_definitions(_graphics-hook INTERFACE COMPILE_D3D12_HOOK)
|
||||
|
||||
target_link_libraries(_graphics-hook INTERFACE OBS::d3d8-api OBS::hook-config OBS::ipc-util OBS::obfuscate
|
||||
Detours::Detours dxguid)
|
||||
target_link_libraries(
|
||||
_graphics-hook
|
||||
INTERFACE OBS::d3d8-api OBS::hook-config OBS::ipc-util OBS::obfuscate Detours::Detours dxguid
|
||||
)
|
||||
|
||||
target_link_options(_graphics-hook INTERFACE /IGNORE:4099)
|
||||
|
||||
@@ -51,8 +54,6 @@ target_link_libraries(graphics-hook PRIVATE _graphics-hook)
|
||||
|
||||
include(cmake/32bit.cmake)
|
||||
|
||||
# cmake-format: off
|
||||
set_target_properties_obs(graphics-hook PROPERTIES FOLDER "plugins/win-capture" OUTPUT_NAME graphics-hook64 MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
# cmake-format: on
|
||||
|
||||
add_dependencies(win-capture graphics-hook)
|
||||
|
||||
@@ -7,6 +7,7 @@ endif()
|
||||
add_library(graphics-hook MODULE)
|
||||
target_link_libraries(graphics-hook PRIVATE _graphics-hook)
|
||||
|
||||
# cmake-format: off
|
||||
set_target_properties(graphics-hook PROPERTIES OUTPUT_NAME graphics-hook32 MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
# cmake-format: on
|
||||
set_target_properties(
|
||||
graphics-hook
|
||||
PROPERTIES OUTPUT_NAME graphics-hook32 MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>"
|
||||
)
|
||||
|
||||
@@ -2,4 +2,5 @@ add_custom_command(
|
||||
TARGET graphics-hook
|
||||
POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_SOURCE_DIR}/build_x86 --config $<CONFIG> -t graphics-hook
|
||||
COMMENT "Build 32-bit graphics-hook")
|
||||
COMMENT "Build 32-bit graphics-hook"
|
||||
)
|
||||
|
||||
@@ -17,8 +17,6 @@ target_link_libraries(inject-helper PRIVATE _inject-helper)
|
||||
|
||||
include(cmake/32bit.cmake)
|
||||
|
||||
# cmake-format: off
|
||||
set_target_properties_obs(inject-helper PROPERTIES FOLDER plugins/win-capture OUTPUT_NAME inject-helper64 MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
# cmake-format: on
|
||||
|
||||
add_dependencies(win-capture inject-helper)
|
||||
|
||||
@@ -3,6 +3,7 @@ project(inject-helper)
|
||||
add_executable(inject-helper)
|
||||
target_link_libraries(inject-helper PRIVATE _inject-helper)
|
||||
|
||||
# cmake-format: off
|
||||
set_target_properties(inject-helper PROPERTIES OUTPUT_NAME inject-helper32 MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
# cmake-format: on
|
||||
set_target_properties(
|
||||
inject-helper
|
||||
PROPERTIES OUTPUT_NAME inject-helper32 MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>"
|
||||
)
|
||||
|
||||
@@ -2,4 +2,5 @@ add_custom_command(
|
||||
TARGET inject-helper
|
||||
POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_SOURCE_DIR}/build_x86 --config $<CONFIG> -t inject-helper
|
||||
COMMENT "Build 32-bit inject-helper")
|
||||
COMMENT "Build 32-bit inject-helper"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user