当前位置:   article > 正文

Cmakelists配置工程src和include文件_cmakelists把include和src文件

cmakelists把include和src文件

1、用aux_source_directory来配置src文件,但不能配置include文件

aux_source_directory(./src SRC_FILES)

file(GLOB_RECURSE project_HEADERS

                                         "a.h"

                                         "b.h" )

add_executable(${PROJECT_NAME}  ${SRC_FILES}  ${project_HEADERS})

这种方法不用挨个儿写src目录下的cpp文件,省事些

2、

file(GLOB_RECURSE  project_SOURSES

                                          "main.h"

                                          "a.h"

                                          "b.h"  )

file(GLOB_RECURSE project_HEADERS

                                         "a.h"

                                         "b.h" )

add_executable(${PROJECT_NAME}  ${PROJECT_SOURCES}  ${PROJECT_HEADERS})

 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小小林熬夜学编程/article/detail/292927
推荐阅读
相关标签
  

闽ICP备14008679号