[CMake] Using a toplevel CMakeList.txt to build all sub projects at once.

Marcel Loose loose at astron.nl
Thu Feb 6 04:05:28 EST 2014


On 06/02/14 07:14, PCMan wrote:
> Hello,
> I'm PCMan, one of the developers of LXDE desktop (now LxQt after
> merged with Razor-qt project).
> http://lxde.org/ and http://razor-qt.org/
>
> We're migrating from gtk+ to Qt and autotools to CMake and encountered
> some issues.
> There are many small modules or components in our project.
> Each of them has their own CMakeLists.txt and can be built separately.
> However, it's hard to build so many projects manually.
> So we'd like to create a toplevel CMakeLists.txt to build them all at once.
> However, the small projects depend on each other.
> For example, our project layout look like this:
>
> libqtxdg - a base lib required by others
> liblxqt - a library depends on libqtxdg
> lxqt-config - a tool depends on liblxqt and libqtxdg.
>
> To build lxqt-config, liblxqt and libqtxdg need to be "installed" first.
> So simply adding them using add_subdirectoyy() won't work.
> When configuring lxqt-config, liblxqt needs to be installed first.
> To configure and compile liblxqt, cmake modules and headers from
> libqtxdg are required so libqtxdg needs to be installed first.
>
> Is it possible to use CMake to build them all at once since one
> component requires that the other is installed first.
>
> Even worse, two of our components are still automake-based.
> The cmake ExternalProject_Add() command did not solve the problem that
> some of them needs to be "installed" first before others can be
> compiled.
>
> I tried to google and read the existing docs but remain clueless.
> We're stuck! Any help is really appreciated.
> Thank you very much!
Hi PCMan,

It depends very much on what you mean by "installed". We're in a similar
situation. We have a lot of so-called packages in our project, that can
depend on other (internal) packages. I've setup a build system, using
CMake, that can build these packages in the right order without actually
installing them. We don't have any Autotools-based packages, but it
shouldn't be too hard (I guess) to wrap these as a separate package.

Best regards,
Marcel Loose.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: loose.vcf
Type: text/x-vcard
Size: 292 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140206/d0e18ff0/attachment.vcf>


More information about the CMake mailing list