@@ -43,7 +43,7 @@ if(WIN32)
4343endif ()
4444
4545# Create depthai project
46- project (depthai VERSION "2.17.3 " LANGUAGES CXX C)
46+ project (depthai VERSION "2.17.4 " LANGUAGES CXX C)
4747get_directory_property (has_parent PARENT_DIRECTORY )
4848if (has_parent)
4949 set (DEPTHAI_VERSION ${PROJECT_VERSION} PARENT_SCOPE)
@@ -435,13 +435,14 @@ target_link_libraries(${TARGET_CORE_NAME}
435435 ZLIB::zlib
436436)
437437
438- # Add compile definitions
438+ # Add compile & CMake definitions
439+ set (DEPTHAI_DEVICE_VERSION "${DEPTHAI_DEVICE_SIDE_COMMIT} " )
439440target_compile_definitions (${TARGET_CORE_NAME}
440441 PRIVATE
441442 # XLink required define
442443 __PC__
443444 # Add depthai-device version
444- DEPTHAI_DEVICE_VERSION="${DEPTHAI_DEVICE_SIDE_COMMIT } "
445+ DEPTHAI_DEVICE_VERSION="${DEPTHAI_DEVICE_VERSION } "
445446 # Add depthai-bootloader version
446447 DEPTHAI_BOOTLOADER_VERSION="${DEPTHAI_BOOTLOADER_VERSION} "
447448)
@@ -458,7 +459,7 @@ if(DEPTHAI_USB2_PATCH_ONLY_MODE)
458459endif ()
459460
460461# Helper function
461- function (add_runtime_dependencies depending_target dependency)
462+ macro (add_runtime_dependencies depending_target dependency)
462463 if (WIN32 )
463464 if (TARGET ${dependency} )
464465 get_property (imported_configs TARGET ${dependency} PROPERTY IMPORTED_CONFIGURATIONS )
@@ -469,13 +470,16 @@ function(add_runtime_dependencies depending_target dependency)
469470 endforeach ()
470471 endif ()
471472 file (GLOB depthai_dll_libraries "${HUNTER_INSTALL_PREFIX} /bin/*.dll" )
473+ # Create a list of required dll files
474+ set (required_dll_files ${dlls} ${depthai_dll_libraries} )
472475 # Copy the required dlls
473476 add_custom_command (TARGET ${depending_target} POST_BUILD COMMAND
474- ${CMAKE_COMMAND} -E copy_if_different ${dlls} ${depthai_dll_libraries } $<TARGET_FILE_DIR:${depending_target} >
477+ ${CMAKE_COMMAND} -E copy_if_different ${required_dll_files } $<TARGET_FILE_DIR:${depending_target} >
475478 COMMAND_EXPAND_LISTS
476479 )
480+ message (STATUS "Required dlls for core are: ${required_dll_files} " )
477481 endif ()
478- endfunction ()
482+ endmacro ()
479483# Add libusb dll in build time
480484add_runtime_dependencies(${TARGET_CORE_NAME} usb-1.0)
481485
@@ -657,6 +661,10 @@ if(DEPTHAI_INSTALL)
657661 if (NOT DEPTHAI_BINARIES_RESOURCE_COMPILE)
658662 install (DIRECTORY "${DEPTHAI_RESOURCES_OUTPUT_DIR} /" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR} /${PROJECT_NAME} " )
659663 endif ()
664+ # Install any required dll files
665+ if (DEFINED required_dll_files)
666+ install (FILES ${required_dll_files} DESTINATION "${CMAKE_INSTALL_BINDIR} " )
667+ endif ()
660668
661669 # Install export group (information about targets)
662670 install (EXPORT ${PROJECT_EXPORT_GROUP}
0 commit comments