About structuring cmake for big project?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

About structuring cmake for big project?

Carlton banks
Is there some literature that desbribes how cmakelist has to be defined a big system, that involve multiple smaller modules within the big module.


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: About structuring cmake for big project?

Sergei Nikulov
2017-10-25 12:36 GMT+03:00 Carlton Banks <[hidden email]>:
> Is there some literature that desbribes how cmakelist has to be defined a big system, that involve multiple smaller modules within the big module.
>

IMHO, this is not CMake specific question.
There is no single recipe which fits all your needs.
You'll be able to describe any big system in CMake, but project code
base representation should be based on agreements within your team.

--
Best Regards,
Sergei Nikulov
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: About structuring cmake for big project?

Volker Enderlein
In reply to this post by Carlton banks
Am 25/10/2017 um 11:36 schrieb Carlton Banks:
> Is there some literature that desbribes how cmakelist has to be defined a big system, that involve multiple smaller modules within the big module.
>
>
It depends, but maybe Mathieu Roperts presentation from CPPCON 2017
gives you some insights.

https://www.youtube.com/watch?v=eC9-iRN2b04


Cheers Volker


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: About structuring cmake for big project?

Nicholas Devenish
In reply to this post by Carlton banks
On Wed, Oct 25, 2017 at 10:36 AM, Carlton Banks <[hidden email]> 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

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: About structuring cmake for big project?

Carlton banks
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 <[hidden email]>:

On Wed, Oct 25, 2017 at 10:36 AM, Carlton Banks <[hidden email]> 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


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: About structuring cmake for big project?

Boudewijn Rempt
In reply to this post by Nicholas Devenish
On Wed, 25 Oct 2017, Nicholas Devenish wrote:

> 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.

Well, there's a lot in the KDE community, but when starting out with
cmake for a large project, it really might help to take a look at
extra-cmake-modules first (https://api.kde.org/ecm/) because it contains
a lot of useful stuff, and then at just one large KDE project, like my
own, Krita. Krita actually contains two cmake systems: one to build Krita
(which consists of several executables, a bunch of libraries and a host
of plugins), and one to download and build all dependencies using cmake
external projects.

I'm sure it can and should be improved and modernized, but it's at
least an example :-)


--
Boudewijn Rempt | http://www.krita.org, http://www.valdyas.org
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: About structuring cmake for big project?

CMake mailing list
In reply to this post by Carlton banks
Daniel Pfeifer's Effective CMake talk is a really great resource:

https://www.youtube.com/watch?v=bsXLMQ6WgIk

There is also this wiki that goes over best practices and guidelines based on
two of Daniel's cmake talks:

https://github.com/boost-cmake/bcm/wiki/Cmake-best-practices-and-guidelines

Also, this goes over the structure that boost is planning on using with cmake:

http://bcm.readthedocs.io/en/latest/src/Building.html

Although it leans towards using its own set of modules called BCM, it does
explain the structure without using BCM as well.

On Wed, 2017-10-25 at 11:36 +0200, Carlton Banks 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. 
>
>
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake