gpt4 book ai didi

c++ - 在 cmake add_executable 中使用 *.cpp

转载 作者:太空宇宙 更新时间:2023-11-04 13:53:03 24 4
gpt4 key购买 nike

比如我在src目录下有很多源文件。我怎样才能做类似 add_executable(ex src/*.cpp) 的事情?

最佳答案

这可以使用 file manipulation command 来实现

file(GLOB My_Source_Files src/*.cpp)
add_executable(ex ${My_Source_Files})

关于c++ - 在 cmake add_executable 中使用 *.cpp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22740499/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com