clion 构建配置。如何建立多个目标?

clion build configuration. How to build multiple targets?

任何人都可以告诉我如何配置 cLion Run/Debug 配置以便它构建发布和调试,以及我想要的任何其他配置吗?我正在尝试输出我的 .lib d.lib 以便它们可以使用...我尝试添加 "before launch" 并在那里添加 debug/release 但似乎什么也没做...

附带问题,1 个项目如何执行第 2 个项目构建,以便我始终可以确保我的库是最新的?

TIA!

Clion > 编辑配置 > +(add) > Compound > 在那里添加你想要的输出。

点击构建,它就会发生。

在 CMakeLists.txt 中添加简单的解决方法:

add_custom_target(MyGroupOfTargets)
add_dependencies(MyGroupOfTargets
    MyApp1
    MyApp2 # any cmake valid target you want
    FancyApp
    MyLib
    )

现在您可以在 Clion 中构建目标 MyGroupOfTargets