clion build configuration. How to build multiple targets?

Viewed 1504

Can any1 tell me how to configure cLion Run/Debug configuration so it builds both release and debug, and any other config I would like to? I'm trying to output my .lib d.lib so they are ready for usage... I tried adding "before launch" and add debug/release there but seem to not do anything...

A side question, how can 1 project execute 2nd project builds so that I can always make sure my libs are up to date?

TIA!

2 Answers

Clion > editConfiguration > +(add) > Compound > add ur desired outs there.

Hit build and it will make it happen.

Simple workaround for this in CMakeLists.txt add:

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

Now in Clion you can build target MyGroupOfTargets

Related