Author Topic: Rerun cmake before building  (Read 1751 times)

Offline marmistrz

  • Multiple posting newcomer
  • *
  • Posts: 18
Rerun cmake before building
« 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 ;/
« Last Edit: April 23, 2016, 11:49:26 am by marmistrz »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13165
    • Travis build status
Re: Rerun cmake before building
« Reply #1 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline marmistrz

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Rerun cmake before building
« Reply #2 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?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13165
    • Travis build status
Re: Rerun cmake before building
« Reply #3 on: April 23, 2016, 03:36:11 pm »
Try Tools -> Configure tools.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]