Skip to content

Commit

Permalink
more dlls
Browse files Browse the repository at this point in the history
  • Loading branch information
summeroff committed Jan 21, 2025
1 parent 1024017 commit 26b3afc
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions libobs/cmake/os-windows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ target_link_options(libobs PRIVATE /IGNORE:4098 /SAFESEH:NO)
set_target_properties(libobs PROPERTIES PREFIX "" OUTPUT_NAME "obs")

if(NOT ENABLE_UI)
set(DEP_BINARIES
set(DEPENDENCY_DLLS
$<TARGET_FILE:FFmpeg::avcodec>
$<TARGET_FILE:FFmpeg::avformat>
$<TARGET_FILE:FFmpeg::avutil>
Expand All @@ -84,24 +84,28 @@ set(DEP_BINARIES
$<TARGET_FILE:FFmpeg::ffprobeexe>
$<TARGET_FILE:Libx264::Libx264>

# zlib.lib (import library or static lib):
$<TARGET_FILE:ZLIB::ZLIB>

# zlib.dll (up one folder from 'lib', then into 'bin'):
"$<TARGET_FILE_DIR:ZLIB::ZLIB>/../bin/zlib.dll"
"$<TARGET_FILE_DIR:Librist::Librist>/../bin/librist.dll"
"$<TARGET_FILE_DIR:Libsrt::Libsrt>/../bin/srt.dll"
)
set(DEPENDENCY_LIBS
$<TARGET_FILE:Libsrt::Libsrt>
$<TARGET_FILE:Librist::Librist>
$<TARGET_FILE:ZLIB::ZLIB>
)

foreach(DEP_BINARY ${DEP_BINARIES})
message(STATUS "Adding custom command to copy ${DEP_BINARY} to ${OBS_EXECUTABLE_DESTINATION}")
# foreach(DEP_BINARY ${DEPENDENCY_DLLS})
# message(STATUS "Adding custom command to copy ${DEP_BINARY} to ${OBS_EXECUTABLE_DESTINATION}")

add_custom_command(TARGET libobs POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E echo "Copying dependencies binaries ${DEP_BINARY} to ${OBS_EXECUTABLE_DESTINATION}"
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${DEP_BINARY}" "${OBS_EXECUTABLE_DESTINATION}"
COMMENT "."
VERBATIM COMMAND_EXPAND_LISTS
)
endforeach()
# add_custom_command(TARGET libobs POST_BUILD
# COMMAND "${CMAKE_COMMAND}" -E echo "Copying dependencies binaries ${DEP_BINARY} to ${OBS_EXECUTABLE_DESTINATION}"
# COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${DEP_BINARY}" "${OBS_EXECUTABLE_DESTINATION}"
# COMMENT "."
# VERBATIM COMMAND_EXPAND_LISTS
# )
# endforeach()

install(FILES ${DEP_BINARIES} DESTINATION ${OBS_EXECUTABLE_DESTINATION})
install(FILES ${DEPENDENCY_DLLS} DESTINATION ${OBS_EXECUTABLE_DESTINATION})
install(FILES ${DEPENDENCY_LIBS} DESTINATION ${OBS_LIBRARY_DESTINATION})

endif()

0 comments on commit 26b3afc

Please sign in to comment.