• cmake添加指定源文件的命令


    不想用aux_source_directory,可参考如下:

     1 cmake_minimum_required(VERSION 2.6)
     2 SET(CMAKE_C_COMPILER "E:/MinGW-W64/mingw64/bin/gcc.exe")
     3 project(wdg_autosar_test)
     4 SET(EB_OutPut_Src "${CMAKE_CURRENT_SOURCE_DIR}/../Wdg_ZX_K14xM_EB_OutPut/ewdt_direct_service/Src")
     5 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../Wdg_ZX_K14xM/Inc
     6                     ${CMAKE_CURRENT_SOURCE_DIR}/../Base_ZX_K14xM/Inc
     7                     ${CMAKE_CURRENT_SOURCE_DIR}/../Wdg_ZX_K14xM/Inc/pb_pc_cfg_inc_files
     8                     ${CMAKE_CURRENT_SOURCE_DIR}/../WdgIf_ZX_K14xM/include
     9                     ${CMAKE_CURRENT_SOURCE_DIR}/../Wdg_ZX_K14xM_EB_OutPut/ewdt_direct_service/include
    10                     )#添加头文件路径
    11 
    12 aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/../Wdg_ZX_K14xM/Src SRC_LIST_DRV)
    13 aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/../Wdg_ZX_K14xM/Inc/pb_pc_cfg_inc_files SRC_COMMON)
    14 add_executable( wdg_autosar_test 
    15                 main.c 
    16                 ${EB_OutPut_Src}/Wdg_Drv_PBcfg.c 
    17                 ${EB_OutPut_Src}/Wdg_Drvw_PBcfg.c 
    18                 ${EB_OutPut_Src}/Wdg_PBcfg.c 
    19                 ${EB_OutPut_Src}/Wdg_PCcfg.c 
    20                 ${SRC_LIST_DRV} 
    21                 ${SRC_COMMON}
    22             )#注意添加相应的c文件
  • 相关阅读:
    linux命令(一)
    Maven 打包不同环境
    Spring动态代理
    Spring MVC controller方法和jstl
    logback的使用
    从文本导入导出
    将临时全局表中的符合字段导入test数据库中
    将上传的新表导入临时全局表中
    建立临时表导入
    查询统计表以及删除表
  • 原文地址:https://www.cnblogs.com/kunshanpipixia/p/16362928.html
Copyright © 2020-2023  润新知