Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CLion build depend targets

Tags:

cmake

clion

My CLions CMakeLists.txt contains more than 1 target (libraries and depends executables). How can I configure building all targets in one click, instead of choosing target one by one and building them? For example, in Visual Studio I can configure project dependencies and build all solution. CLions "Edit configurations..."->"Before launch:Build" won't work for me.

like image 724
Raman Avatar asked Nov 23 '22 04:11

Raman


1 Answers

You can add the command add_dependencies to your CMakeLists.txt, it does what you want:

Make a top-level target depend on other top-level targets to ensure that they build before does.

Then you just need to create a "BUILD_ALL" target that depends on every other target.

like image 119
Daniel Avatar answered Dec 09 '22 11:12

Daniel