• 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文件
  • 相关阅读:
    php字符串处理函数大全 转
    php http Manual
    HTTP协议详解 百度文库
    PHP获取指定日期的上个月的日期 转
    计算指定日期的前N个月日期
    MySQL之count(*)与count(id)效率比较<转>
    生成器
    可迭代对象_迭代器
    变量内容的删除替换和替代
    软件磁盘阵列
  • 原文地址:https://www.cnblogs.com/kunshanpipixia/p/16362928.html
Copyright © 2020-2023  润新知