@@ -40,7 +40,7 @@ if(WIN32)
4040endif ()
4141
4242# Create depthai project
43- project (depthai VERSION "2.17.3 " LANGUAGES CXX C)
43+ project (depthai VERSION "2.17.4 " LANGUAGES CXX C)
4444get_directory_property (has_parent PARENT_DIRECTORY )
4545if (has_parent)
4646 set (DEPTHAI_VERSION ${PROJECT_VERSION} PARENT_SCOPE)
@@ -431,13 +431,14 @@ target_link_libraries(${TARGET_CORE_NAME}
431431 ZLIB::zlib
432432)
433433
434- # Add compile definitions
434+ # Add compile & CMake definitions
435+ set (DEPTHAI_DEVICE_VERSION "${DEPTHAI_DEVICE_SIDE_COMMIT} " )
435436target_compile_definitions (${TARGET_CORE_NAME}
436437 PRIVATE
437438 # XLink required define
438439 __PC__
439440 # Add depthai-device version
440- DEPTHAI_DEVICE_VERSION="${DEPTHAI_DEVICE_SIDE_COMMIT } "
441+ DEPTHAI_DEVICE_VERSION="${DEPTHAI_DEVICE_VERSION } "
441442 # Add depthai-bootloader version
442443 DEPTHAI_BOOTLOADER_VERSION="${DEPTHAI_BOOTLOADER_VERSION} "
443444)
@@ -454,7 +455,7 @@ if(DEPTHAI_USB2_PATCH_ONLY_MODE)
454455endif ()
455456
456457# Helper function
457- function (add_runtime_dependencies depending_target dependency)
458+ macro (add_runtime_dependencies depending_target dependency)
458459 if (WIN32 )
459460 if (TARGET ${dependency} )
460461 get_property (imported_configs TARGET ${dependency} PROPERTY IMPORTED_CONFIGURATIONS )
@@ -465,13 +466,16 @@ function(add_runtime_dependencies depending_target dependency)
465466 endforeach ()
466467 endif ()
467468 file (GLOB depthai_dll_libraries "${HUNTER_INSTALL_PREFIX} /bin/*.dll" )
469+ # Create a list of required dll files
470+ set (required_dll_files ${dlls} ${depthai_dll_libraries} )
468471 # Copy the required dlls
469472 add_custom_command (TARGET ${depending_target} POST_BUILD COMMAND
470- ${CMAKE_COMMAND} -E copy_if_different ${dlls} ${depthai_dll_libraries } $<TARGET_FILE_DIR:${depending_target} >
473+ ${CMAKE_COMMAND} -E copy_if_different ${required_dll_files } $<TARGET_FILE_DIR:${depending_target} >
471474 COMMAND_EXPAND_LISTS
472475 )
476+ message (STATUS "Required dlls for core are: ${required_dll_files} " )
473477 endif ()
474- endfunction ()
478+ endmacro ()
475479# Add libusb dll in build time
476480add_runtime_dependencies(${TARGET_CORE_NAME} usb-1.0)
477481
@@ -653,6 +657,10 @@ if(DEPTHAI_INSTALL)
653657 if (NOT DEPTHAI_BINARIES_RESOURCE_COMPILE)
654658 install (DIRECTORY "${DEPTHAI_RESOURCES_OUTPUT_DIR} /" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR} /${PROJECT_NAME} " )
655659 endif ()
660+ # Install any required dll files
661+ if (DEFINED required_dll_files)
662+ install (FILES ${required_dll_files} DESTINATION "${CMAKE_INSTALL_BINDIR} " )
663+ endif ()
656664
657665 # Install export group (information about targets)
658666 install (EXPORT ${PROJECT_EXPORT_GROUP}
0 commit comments