0
点赞
收藏
分享

微信扫一扫

Clion

素锦时年_1b00 2022-04-16 阅读 202
c++

clion

CLion里在一个工程下创建多个main文件

需要修改CMakeLists.txt这个文件里的内容

#遍历项目根目录下所有的 cpp文件
file (GLOB files *.c)
foreach (file ${files})
    string(REGEX REPLACE ".+/(.+)\\..*" "\\1" exe ${file})
    add_executable (${exe} ${file} scanf.c)
    message (\ \ \ \ --\ src/${exe}.c\ will\ be\ compiled\ to\ bin/${exe})
endforeach ()
举报

相关推荐

0 条评论