win-capture: Fix subprojects not installing on incremental builds

When changing a subproject (e.g. graphics-hook), the generated binaries
are not installed without also building win-capture. This commit enables
the subprojects to be treated as "plugins" which are installed to rundir
and also the installation directory without any additional workarounds.
master
PatTheMav 2022-07-12 20:00:02 +02:00 committed by Ryan Foster
parent 48c52c9d74
commit 9145e3063d
3 changed files with 8 additions and 14 deletions

View File

@ -20,8 +20,6 @@ target_link_libraries(get-graphics-offsets d3d9.lib dxgi.lib d3d11.lib)
if(MSVC)
target_compile_options(get-graphics-offsets
PRIVATE "$<IF:$<CONFIG:Debug>,/MTd,/MT>")
add_target_resource(win-capture "$<TARGET_PDB_FILE:get-graphics-offsets>"
"obs-plugins/win-capture/" OPTIONAL)
endif()
set_target_properties(get-graphics-offsets PROPERTIES FOLDER
@ -32,7 +30,7 @@ set_target_properties(
"get-graphics-offsets$<IF:$<EQUAL:${CMAKE_SIZEOF_VOID_P},8>,64,32>"
)
add_target_resource(win-capture "$<TARGET_FILE:get-graphics-offsets>"
"obs-plugins/win-capture/")
set(OBS_PLUGIN_DESTINATION "${OBS_DATA_DESTINATION}/obs-plugins/win-capture/")
setup_plugin_target(get-graphics-offsets)
add_dependencies(win-capture get-graphics-offsets)

View File

@ -34,8 +34,6 @@ target_link_options(graphics-hook PRIVATE "LINKER:/IGNORE:4099")
if(MSVC)
target_compile_options(graphics-hook PRIVATE "$<IF:$<CONFIG:Debug>,/MTd,/MT>")
add_target_resource(win-capture "$<TARGET_PDB_FILE:graphics-hook>"
"obs-plugins/win-capture/" OPTIONAL)
endif()
set_target_properties(
@ -54,14 +52,14 @@ if(TARGET Vulkan::Vulkan)
target_compile_definitions(graphics-hook PRIVATE COMPILE_VULKAN_HOOK)
add_target_resource(
win-capture "${CMAKE_CURRENT_SOURCE_DIR}/obs-vulkan64.json"
graphics-hook "${CMAKE_CURRENT_SOURCE_DIR}/obs-vulkan64.json"
"obs-plugins/win-capture/")
add_target_resource(
win-capture "${CMAKE_CURRENT_SOURCE_DIR}/obs-vulkan32.json"
graphics-hook "${CMAKE_CURRENT_SOURCE_DIR}/obs-vulkan32.json"
"obs-plugins/win-capture/")
endif()
add_target_resource(win-capture "$<TARGET_FILE:graphics-hook>"
"obs-plugins/win-capture/")
set(OBS_PLUGIN_DESTINATION "${OBS_DATA_DESTINATION}/obs-plugins/win-capture/")
setup_plugin_target(graphics-hook)
add_dependencies(win-capture graphics-hook)

View File

@ -10,8 +10,6 @@ target_include_directories(inject-helper PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..)
if(MSVC)
target_compile_options(inject-helper PRIVATE "$<IF:$<CONFIG:Debug>,/MTd,/MT>")
add_target_resource(win-capture "$<TARGET_PDB_FILE:inject-helper>"
"obs-plugins/win-capture/" OPTIONAL)
endif()
set_target_properties(
@ -20,7 +18,7 @@ set_target_properties(
OUTPUT_NAME
"inject-helper$<IF:$<EQUAL:${CMAKE_SIZEOF_VOID_P},8>,64,32>")
add_target_resource(win-capture "$<TARGET_FILE:inject-helper>"
"obs-plugins/win-capture/")
set(OBS_PLUGIN_DESTINATION "${OBS_DATA_DESTINATION}/obs-plugins/win-capture/")
setup_plugin_target(inject-helper)
add_dependencies(win-capture inject-helper)