1

I have a cmake project which is something like my personal codebase/portfolio, which contains >100 render targers (libraries and examples for different algorithms and sketches). I'm starting to have some problems with heaving everything in one cmake project. For example:

  • I would like to make some smaller self-contained sub-sets of functionality which would ommit some dependencies, or add some dependency which I don't what to have in the main project
  • Recompilation of the whole project takes long time
  • In my IDE (Code::Blocks) it takes me quite long time to find particular file or build target, since there is many of them
  • Because some targets are dynamic libraries I have to compile everything with -fPIC due to inter-dependencies. But for some application ommiting -fPIC can give additional speed.

I'm thinking to create several independent cmake project to manage these things more easily, but these project would share considerable part of codebase.

I guess this problem should be quite common, so I would like to know how other people solve it.

Prokop Hapala
  • 2,424
  • 2
  • 30
  • 59
  • 1
    Have a look at http://stackoverflow.com/q/6459686/2799037 Also external project might be a good approach to achieve what you want: https://cmake.org/cmake/help/v3.7/module/ExternalProject.html – usr1234567 Dec 03 '16 at 12:46
  • My thoughts on this can be found [here](http://stackoverflow.com/questions/31512485/cmake-how-to-setup-source-library-and-cmakelists-txt-dependencies). Mainly it will depend on how good you have defined your project dependencies. It shouldn't rebuild the parts of your project where the executable target in question doesn't have a dependency to. – Florian Dec 03 '16 at 16:53

0 Answers0