Author Topic: Best way to use CMake for build  (Read 6080 times)

Offline rhasselbaum

  • Single posting newcomer
  • *
  • Posts: 2
Best way to use CMake for build
« on: January 15, 2010, 10:34:56 pm »
Is there a pattern for setting up a Code::Blocks project to use CMake for the build? Ideally, I want Code::Blocks to invoke CMake as a pre-build step to generate a Makefile and then have Code::Blocks invoke that Makefile to build the project.

I figured out that I can point it to a custom Makefile by going to project properties, specifying one in the Project Settings tab, and selecting "This is a custom Makefile". Will that turn off Code::Block's own compiler/linker invocations? How can I set up the pre-build step? I found the Pre/Post-Build Steps tab under Build Options, but the controls are disabled.

Am I going about this the right way? Thanks!

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Best way to use CMake for build
« Reply #1 on: January 15, 2010, 10:55:21 pm »
If you use a nightly build, you can use pre- and post-build steps together with custom makefiles.

Offline rhasselbaum

  • Single posting newcomer
  • *
  • Posts: 2
Re: Best way to use CMake for build
« Reply #2 on: January 16, 2010, 02:20:45 pm »
Thanks. Is the nightly build stable?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Best way to use CMake for build
« Reply #3 on: January 16, 2010, 03:21:20 pm »
Thanks. Is the nightly build stable?
Yes, but the next one will be even better suited for large (!) projects.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ