在CMakeLists.txt中,要对某些子文件夹全部进行编译则使用

add_subdirectory(examples)

那如果在examples文件夹中建立了某个目录如examples/venv,此时venv中的内容不需要被编译,那么在CMakeLists.txt中应修改如下:

add_subdirectory(examples EXCLUDE_FROM_ALL examples/venv

 

相关文章: