1. 程式人生 > >CLion單project 多 可執行檔案

CLion單project 多 可執行檔案

在CmakeList.txt 中加入add_executable就可以了

add_executable(test2 test2/main2.cpp)

另外,也可以用子目錄的方式

add_subdirectory(test2)

在子目錄中同樣需要建立新的CmakeList.txt 並加入add_executable

add_executable(test2 main2.cpp)

https://blog.csdn.net/ShawnAtCSDB/article/details/78785602
https://blog.csdn.net/gaowu959/article/details/78484725