代码拉取完成,页面将自动刷新
cmake_minimum_required(VERSION 3.0.0)
project(UDS_Tool VERSION 0.1.0 LANGUAGES C CXX)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# set(CMAKE_PREFIX_PATH G:/Qt/5.15.2/msvc2019/lib/cmake/Qt5)
set(CMAKE_PREFIX_PATH E:/Qt/5.14.2/5.14.2/msvc2017/lib/cmake/Qt5)
find_package(Qt5 REQUIRED COMPONENTS Widgets)
include_directories(${PROJECT_SOURCE_DIR}/lib_iso15765
${PROJECT_SOURCE_DIR}/client
${PROJECT_SOURCE_DIR}/lib_Device/Peak
${PROJECT_SOURCE_DIR}/lib_Device/Vector
${PROJECT_SOURCE_DIR}/lib_Device/ZLG
${PROJECT_SOURCE_DIR}/Sources
${PROJECT_SOURCE_DIR}/LoadImage
)
aux_source_directory(${PROJECT_SOURCE_DIR}/lib_iso15765 ISOTP_LIST)
aux_source_directory(${PROJECT_SOURCE_DIR}/client CLIENT_LIST)
aux_source_directory(${PROJECT_SOURCE_DIR}/lib_Device/Peak PEAK_LIST)
aux_source_directory(${PROJECT_SOURCE_DIR}/lib_Device/Vector VECTOR_LIST)
aux_source_directory(${PROJECT_SOURCE_DIR}/lib_Device/ZLG ZLG_LIST)
aux_source_directory(${PROJECT_SOURCE_DIR}/Sources SRC_LIST)
aux_source_directory(${PROJECT_SOURCE_DIR}/LoadImage LOAD_LIST)
find_library(ZLG_LIB ControlCAN ${PROJECT_SOURCE_DIR}/lib_Device/ZLG)
find_library(PEAK_LIB PCANBasic ${PROJECT_SOURCE_DIR}/lib_Device/Peak)
find_library(Vector_LIB vxlapi ${PROJECT_SOURCE_DIR}/lib_Device/Vector)
add_executable(${PROJECT_NAME} ${ISOTP_LIST} ${PEAK_LIST} ${VECTOR_LIST} ${ZLG_LIST} ${SRC_LIST} ${CLIENT_LIST} ${LOAD_LIST})
target_link_libraries(${PROJECT_NAME} ${Vector_LIB} ${ZLG_LIB} ${PEAK_LIB} Qt5::Widgets)
# set(CPACK_PROJECT_NAME ${PROJECT_NAME})
# set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
set(DEST_FOLDERS "Debug" "MinSizeRel" "Release" "RelWithDebInfo")
foreach(DEST_FOLDER ${DEST_FOLDERS})
file(COPY ${PROJECT_SOURCE_DIR}/lib_Device/ZLG/ControlCAN.dll DESTINATION ${DEST_FOLDER})
file(COPY ${PROJECT_SOURCE_DIR}/lib_Device/ZLG/kerneldlls DESTINATION ${DEST_FOLDER})
file(COPY ${PROJECT_SOURCE_DIR}/lib_Device/Peak/PCANBasic.dll DESTINATION ${DEST_FOLDER})
file(COPY ${PROJECT_SOURCE_DIR}/lib_Device/Vector/vxlapi.dll DESTINATION ${DEST_FOLDER})
execute_process(
# add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_PREFIX_PATH}/../../../bin/windeployqt.exe ${PROJECT_NAME}.exe
WORKING_DIRECTORY ${DEST_FOLDER}
)
endforeach()
# include(CPack)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。