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.
This commit is contained in:
PatTheMav
2022-07-13 15:52:13 -04:00
committed by Ryan Foster
parent 48c52c9d74
commit 9145e3063d
3 changed files with 8 additions and 14 deletions
@@ -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)