Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,9 @@ set_property(TARGET ${TARGET_NAME} PROPERTY CXX_STANDARD 17)

# Windows - Add runtime dependencies
if(WIN32)
if(CMAKE_VERSION VERSION_LESS "3.21")
message(WARNING "CMake version less than 3.21 - automatic DLL handling not available. Make sure to copy required DLLs to the same folder as .exe")
else()
# TARGET_RUNTIME_DLLS generator expression available since CMake 3.21
set(depthai_dll_libraries "$<TARGET_RUNTIME_DLLS:${TARGET_NAME}>")
# Copy the required dlls
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD COMMAND
${CMAKE_COMMAND} -E copy_if_different ${depthai_dll_libraries} $<TARGET_FILE_DIR:${TARGET_NAME}>
COMMAND_EXPAND_LISTS
)
endif()
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${DEPTHAI_INSTALL_PREFIX}/bin"
$<TARGET_FILE_DIR:${TARGET_NAME}>
)
endif()