I would like to have the following structure A -> B -> C, where:
Cis boilerplate code, wrappers for third-party libraries, very basic code etc.Bis the common classes, functions and data structures specific to the project's domain.Ais the project itself.
I would like to make it easy to reuse C or B(+C) in future in my other projects. In addition, I have the following requirements:
- As all three projects are in-progress, I would like to have an ability to build
C,C+BandC+B+Ain one shot. - I would prefer the static linkage over dynamic, so that
CandC+Bwould be static libraries, andC+B+Awould be the executable - I would like to keep cmake lists and config files simple and clean. Examples which I found in the official wiki and over the internet are pretty big and monstrous.
- It would be great if it won't require changing more than a couple of lines if I'd change the locations of
A,BorCin the filesystem. - All these three components are using google-test, but I'm not sure if it is important for the project layout.
I am pretty new to cmake and I don't even understand is it better to write XXXConfig.cmake or FindXXX.cmake files. Also, I am not sure, how should I pass relative paths from subcomponent to the parent component using X_INCLUDE_DIRS.