Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: marmistrz on April 23, 2016, 11:39:50 am

Title: Rerun cmake before building
Post by: marmistrz on April 23, 2016, 11:39:50 am
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 ;/
Title: Re: Rerun cmake before building
Post by: oBFusCATed on April 23, 2016, 01:50:17 pm
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.
Title: Re: Rerun cmake before building
Post by: marmistrz on April 23, 2016, 02:47:02 pm
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?
Title: Re: Rerun cmake before building
Post by: oBFusCATed on April 23, 2016, 03:36:11 pm
Try Tools -> Configure tools.