Author Topic: How can I set up a completely command-only build workflow?  (Read 3515 times)

Offline markP0

  • Single posting newcomer
  • *
  • Posts: 2
How can I set up a completely command-only build workflow?
« on: September 18, 2020, 04:52:52 pm »
This has been frustrating me to no end. Following the directions in this thread, I've been trying to set up a non-Makefile based build process but C::B keeps trying to use the default make commands, even if I have "This is a custom Makefile" selected with only a space for the Makefile name. I've also tried using "ninja" in the custom make commands with pre-build steps for changing into a build directory and running CMake, but it still tries to use "make" and won't build. I've also tried switching to *No compiler* but just like in the linked thread, C::B refuses to even attempt a build without a compiler, so I don't know why that option is even there.

When I click "Build," I need to do 3 things:
  • cd into a directory called "build"
  • run cmake ..
  • run ninja

How can I have Code::Blocks just execute these commands when I try to build?

Offline Sowaco

  • Single posting newcomer
  • *
  • Posts: 4
Re: How can I set up a completely command-only build workflow?
« Reply #1 on: September 18, 2020, 09:00:57 pm »
Ähhhhh...

You want to call a build process by calling a "Build System generator" (CMake) to generate another "Build System" (ninja) unknown for CB . All of them inside an IDE with it's own, but Cmake supported build system?

For havens sake. Why?

If you really want to do this, write a simple make file with the commands inside. Done. No headache. No frustration.

Do you know, that you can create CB-projects from CMake? Build in support from CMake. And if you know a litte bit about CMake, than you can update the CB-projects automatically.

Offline markP0

  • Single posting newcomer
  • *
  • Posts: 2
Re: How can I set up a completely command-only build workflow?
« Reply #2 on: September 25, 2020, 05:47:41 am »
Ähhhhh...

You want to call a build process by calling a "Build System generator" (CMake) to generate another "Build System" (ninja) unknown for CB . All of them inside an IDE with it's own, but Cmake supported build system?

For havens sake. Why?

I'm new to this particular project and didn't write their build process. It's... not what I would have gone with, if I were writing it, to put it very nicely.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: How can I set up a completely command-only build workflow?
« Reply #3 on: September 27, 2020, 01:33:02 am »
Why not use cmake to make "CodeBlocks - Ninja" CodeBlocks project file?

Edit: Add link https://cmake.org/cmake/help/v3.0/generator/CodeBlocks.html

Tim S.
« Last Edit: September 27, 2020, 01:41:04 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org