User forums > Using Code::Blocks

Rerun cmake before building

(1/1)

marmistrz:
I'm using a cmake project with C::B. I added a couple of files and got a bunch of compile errors due to the fact I didn't rerun cmake before building. I used aux_source_directory to specify the source directory.

Is there a way to make C::B do that for me whenever I add a new file? I tried using this as a prebuild command, but this reset my project and I have to set up execution and the build cmds once again ;/

oBFusCATed:
Are you using the cmake's codeblocks generators?
And generally it is not good idea to rebuild the projects during build/rebuild/etc.
The visual studio generators are doing this and the user experience is dreadful.
The best thing you could do is to setup a tool that runs "cmake ." in the appropriate directory.

marmistrz:
Yep, I'm using the C::B generator.

Can you please elaborate about 'the best thing I could do'? What kind of tool? An external script, something launched from within C::B?

oBFusCATed:
Try Tools -> Configure tools.

Navigation

[0] Message Index

Go to full version