Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

qtcreator can only build all not each single targets for cmake projects

I use cmake to generate qtcreator's project files, For the run part I can have different targets, but the build parts, I can only select all, and could not build each targets separately. Is there anyway I can build only one targets with qtcreator's cmake projects?

like image 923
emailhy Avatar asked Feb 29 '12 20:02

emailhy


2 Answers

Since QtCreator 4.0.0, on Projects pane, go to build steps -> Details and select your target. You can also use the "--target" command line option with cmake.

Update:

Since QtCreator 4.3.0 with CMake 3.7.2 or greater the list of targets is on the project view, so you can just right click and build.

like image 113
rboc Avatar answered Oct 23 '22 17:10

rboc


With QtCreator 4.0+ it is is possible, see rboc's answer below.


Old answer

I believe this is currently essentially impossible. I say "essentially" because if you wanted to, you could make a custom build configuration for each target you want to create, manually specifying the target as an argument in the command for that configuration. Then, to build that target, simply select that configuration and build. This is an extremely hacky workaround, but unfortunately I think it's the only viable option at the moment. A better solution might be to create a separate project for each target.

like image 4
Kyle Strand Avatar answered Oct 23 '22 16:10

Kyle Strand