赞
踩
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})
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。