如何使用 cmake 添加所有 headers?
How to add all headers using cmake?
对于c++项目,我可以使用
aux_source_directory
添加所有cpp文件;但是此命令不包括 header 个文件;要添加 header 个文件吗?
您可以使用file
命令添加您想要的所有文件,例如
file(GLOB SOURCES
your-folder/*.hxx
your-folder/*.cxx
)
add_executable(yourProj ${SOURCES})
对于c++项目,我可以使用
aux_source_directory
添加所有cpp文件;但是此命令不包括 header 个文件;要添加 header 个文件吗?
您可以使用file
命令添加您想要的所有文件,例如
file(GLOB SOURCES
your-folder/*.hxx
your-folder/*.cxx
)
add_executable(yourProj ${SOURCES})