PatTheMav d42c98fa22
win-capture: Fix added resources not properly copied to rundir
The `add_target_resource` function uses unnecessary path components
when copying files to the rundir, resulting in files added that way
not to end up where OBS expects them to.

The generated binaries created by sub-targets also need to be copied
as part of `win-capture`'s data files, which was easy to fix as the
target exists before CMake switches into the subdirectories.
2022-03-30 11:10:54 +02:00

39 lines
1.2 KiB
CMake

project(get-graphics-offsets)
add_executable(get-graphics-offsets)
target_sources(
get-graphics-offsets
PRIVATE get-graphics-offsets.c
get-graphics-offsets.h
dxgi-offsets.cpp
d3d8-offsets.cpp
d3d9-offsets.cpp
../graphics-hook-info.h
../hook-helpers.h)
target_include_directories(get-graphics-offsets
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..)
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
"plugins/win-capture")
set_target_properties(
get-graphics-offsets
PROPERTIES OUTPUT_NAME
"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/")
add_dependencies(win-capture get-graphics-offsets)