User forums > Using Code::Blocks

Adding files to a project created with cmake

<< < (2/2)

Jenna:
In the projects build options you can chose per target, whether to prepend or append target options to the project options or to use just project or target options (see the policy dropdown-box).

gib:
I never looked at the Policy - that clarifies things a lot.

Thanks!

oBFusCATed:

--- Quote from: gib on July 05, 2017, 01:48:07 am ---I now have a working project that was developed within CB.  This is definitely preferable to what I was doing with cmake.

--- End quote ---
I'm not sure any more that our build system is preferable to cmake's.
To add file to the cmake's build you just edit the cmakelist.txt file that is responsible for the project/target you want to add the file to, then run "cmake ." or build inside codeblocks and the file will be added correctly.
Yes, there is no gui, but using cmake allows you to do way more complex build configuration that will ever be possible in codeblocks.
Also if you have many targets/projects and you're using make or ninja the builds will be faster.

And lastly it seems that C/C++ community is converging to using cmake as the tool to setup/control builds. I don't know if this is good or bad, be we need to support it well in codeblocks...

gib:
There is no doubt that cmake is becoming (or has become) the standard build tool.  It is extremely powerful, and as you say allows much more complex builds than CB.  But for people like me who are never going to develop cmake expertise the simpler, more limited, GUI-based approach of CB makes it easier than writing a CmakeLists.txt file.  I often use cmake, but I'm using CmakeList files developed by somebody else.  The comparison between cmake and CB illustrates the inverse relationship between software power and user-friendliness.

Navigation

[0] Message Index

[*] Previous page

Go to full version