19 lines
410 B
CMake
19 lines
410 B
CMake
|
|
# 示例程序CMakeLists.txt
|
||
|
|
|
||
|
|
# 添加示例可执行文件
|
||
|
|
add_executable(usb2can_example main.cpp)
|
||
|
|
|
||
|
|
# 链接USB2CAN库
|
||
|
|
target_link_libraries(usb2can_example
|
||
|
|
usb2can
|
||
|
|
)
|
||
|
|
|
||
|
|
# 包含目录
|
||
|
|
target_include_directories(usb2can_example PRIVATE
|
||
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../include
|
||
|
|
)
|
||
|
|
|
||
|
|
# 设置输出目录
|
||
|
|
set_target_properties(usb2can_example PROPERTIES
|
||
|
|
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||
|
|
)
|