Author Topic: How do you setup CB to use CMake?  (Read 15103 times)

Offline Napoleon

  • Multiple posting newcomer
  • *
  • Posts: 59
How do you setup CB to use CMake?
« on: April 22, 2014, 03:19:00 pm »
[Ubuntu 13.10, CB 13.12 compiled]

I've been reading in another thread about how CMake supports CB.  I would like to understand how to setup CB to use CMake and existing CMakeList.txt files.  Currently I'm calling a script that runs 'catkin_make', which uses CMake.  I have cmake version 2.8.11.2.


Cheers,
Nap

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: How do you setup CB to use CMake?
« Reply #1 on: April 22, 2014, 05:00:35 pm »
This is just a guess.

Create a separate project to run CMAKE.
(I would use a CB custom makefile project)

That creates another  project (IIRC, a custom makefile project)

Then, create a workspace to hold the two projects.

Step 1, is to use CMAKE to build a CB custom makefile project; have you done that?
(Till you figure out the steps to do that it is a waste of time trying to get CB to do those steps!!)

Tim S.
« Last Edit: April 22, 2014, 05:04:27 pm 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

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: How do you setup CB to use CMake?
« Reply #2 on: April 22, 2014, 05:33:19 pm »
[Ubuntu 13.10, CB 13.12 compiled]

I've been reading in another thread about how CMake supports CB.  I would like to understand how to setup CB to use CMake and existing CMakeList.txt files.  Currently I'm calling a script that runs 'catkin_make', which uses CMake.  I have cmake version 2.8.11.2.


Cheers,
Nap

Code
cmake . -G "CodeBlocks - Unix Makefiles"

Will generate a Code::Blocks project file that you can open, build and run. I could be imagining things but it also appears to magically regenerate the make files when you pull in changes from an external source. On the other hand, I don't think it's easy to add new project files short of editing the CMakelist.txt files.