[CMake] About structuring cmake for big project?

Carlton Banks noflaco at gmail.com
Wed Oct 25 07:59:39 EDT 2017


I am currently entering the stages of building a bigger project, at which multiple submodules has to be involved. 
I am a noob when it comes to cmake, and never worked with it in a big project scale. 

My idea was to make each submodule buildable, such that they could be tested independently (testing each submodule )and all together (In the top module)… 
The idea seem simple, and the project on which i am currently testing it on is not that big (each module = class).  So I don’t understand why there isn’t a easy guide or some form documentation clarifying the use of cmake of module cmake…  
 
> Den 25. okt. 2017 kl. 13.53 skrev Nicholas Devenish <ndevenish at gmail.com>:
> 
> On Wed, Oct 25, 2017 at 10:36 AM, Carlton Banks <noflaco at gmail.com <mailto:noflaco at gmail.com>> wrote:
> Is there some literature that desbribes how cmakelist has to be defined a big system, that involve multiple smaller modules within the big module.
>  
> Unfortunately, written documentation of structuring larger projects with CMake seems to be as rare and hard to find as documentation on CMake "Best practices". I suspect that the individual uniqueness of each large project combined with "once it is working don't touch it" means that developers settle on something that "works" rather than something they are happy with, and so don't show it off.
> 
> If you have anything beyond a fixed repository of code with simple dependencies then you seem to be pretty much on your own.
> 
> As a start, I'd suggest looking for other large projects that transitioned to using CMake - I've found LLVM useful in particular as a large but tightly-bound set of modular, but optional components. KDE is using CMake, but I've yet to find a good place to start digging - the ecosystem is so intimidatingly large that I'm not sure their solutions are applicable to anyone else except them. Hopefully Boost will move to CMake (as is currently proposed) and give another well known library example.
> 
> Nick

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20171025/c11368a0/attachment.html>


More information about the CMake mailing list