Fix for SHSTK

This commit is contained in:
5 changed files with 91 additions and 13 deletions

View File

@@ -3,18 +3,21 @@ cmake_policy(SET CMP0020 NEW)
find_package(PIP REQUIRED)
add_executable(asyncdevicepool asyncdevicepool.cpp)
target_link_libraries(asyncdevicepool PIP can)
if(WIN32)
add_custom_target(copy_dependencies
COMMAND ${CMAKE_COMMAND} -E copy ${PCAN_LIB} ${CMAKE_CURRENT_BINARY_DIR}/PCANBasic${CMAKE_SHARED_LIBRARY_SUFFIX}
COMMAND ${CMAKE_COMMAND} -E copy ${VSCAN_LIB} ${CMAKE_CURRENT_BINARY_DIR}/vs_can_api${CMAKE_SHARED_LIBRARY_SUFFIX})
add_dependencies(asyncdevicepool copy_dependencies)
add_executable(can_send_multithread can_send_multithread.cpp)
target_include_directories(can_send_multithread PUBLIC ${PIP_INCLUDES} ${CAN_INCLUDES})
target_link_libraries(can_send_multithread can)
add_dependencies(can_send_multithread copy_dependencies)
add_executable(can_send can_send.cpp)
target_include_directories(can_send PUBLIC ${PIP_INCLUDES} ${CAN_INCLUDES})
target_link_libraries(can_send can)
add_dependencies(can_send copy_dependencies)
endif()