Creator / cmake: Only build the executable I want to start?
-
My cmake project has about 40 executables that, together, take several seconds to link.
When doing Test-Driven development with Qt , I'd want to only build and link the unit test I'm working with. I could select only that target in the cmake build steps, but the list is very long (>1000 entries) and tedious to work with. I have not found an easy way to quickly switch between "build only unitTest1" and "build all my default build targets".Is there a way to build all build targets when I just say "Build", but only build the desired unit test when I directly start that test?
-
My cmake project has about 40 executables that, together, take several seconds to link.
When doing Test-Driven development with Qt , I'd want to only build and link the unit test I'm working with. I could select only that target in the cmake build steps, but the list is very long (>1000 entries) and tedious to work with. I have not found an easy way to quickly switch between "build only unitTest1" and "build all my default build targets".Is there a way to build all build targets when I just say "Build", but only build the desired unit test when I directly start that test?
@Asperamanca there is the Current executable setting in Build Steps in the Projects pane.
Then when you edit your unittest and hit build, you would build and run only the unittest and not everything.
The other option is with the CTest locator
ct unittestwhich will buildunittestand rununittest. -
A Asperamanca has marked this topic as solved
-
@Asperamanca there is the Current executable setting in Build Steps in the Projects pane.
Then when you edit your unittest and hit build, you would build and run only the unittest and not everything.
The other option is with the CTest locator
ct unittestwhich will buildunittestand rununittest.@cristian-adam Nice, thanks!
-
@Asperamanca there is the Current executable setting in Build Steps in the Projects pane.
Then when you edit your unittest and hit build, you would build and run only the unittest and not everything.
The other option is with the CTest locator
ct unittestwhich will buildunittestand rununittest.@cristian-adam said in Creator / cmake: Only build the executable I want to start?:
Current executable
Checking "current executable" doesn't make a difference - the other (unrelated) executables are still built.
Either I need to set an option additionally (which one?), or I would need to uncheck all the other build targets (tedious) -
A Asperamanca has marked this topic as unsolved
-
@cristian-adam said in Creator / cmake: Only build the executable I want to start?:
Current executable
Checking "current executable" doesn't make a difference - the other (unrelated) executables are still built.
Either I need to set an option additionally (which one?), or I would need to uncheck all the other build targets (tedious)@Asperamanca the another option would be to use ... CMake Presets, there you can define in json the targets that you would want to build ...