[cmake-developers] External projects & library dependencies

Wouter Klouwen wouter.klouwen at youview.com
Tue Apr 11 12:33:13 EDT 2017


Hello all,

I've been converting a large build system to use CMake. At the moment it
consists of a custom build system that builds 250+ projects plus a
series of third party open source packages, that each have their own
build system. After some effort I've been able to convert all of our own
projects to use CMake.

This brings us to the next challenge as I'm now in the position where I
want to create one CMake, so that it can take over from our own build
system.
There's a major thing I can't find a good solution for yet. At the
moment each project is built individually and in order. As there's
multiple levels of build systems involved. So include and link flags
between these projects can be transferred through either CMake packages
or FindPkgConfig, for our own CMake projects and the third party
packages respectively. Both of these methods provide for interface
libraries that can be neatly depended on.

So in order to create a mega project I want to put all of the third
party packages into the build system using ExternalProject_Add.
This function does provide for targets in terms of build dependencies,
but this isn't quite enough. I need these packages to convey information
in the same way as was done through pkg-config files and provide
COMPILE_OPTIONS, INCLUDE_DIRECTORIES and LINK_LIBRARIES.

All of this information is present once the ExternalProject is built as
it would be possible to invoke pkg-config afterwards. This is of course
too late for CMake to resolve this information at configure/build rule
creation time.

Is there a better way of solving this other than effectively duplicating
the information in the pkg-config files so that CMake can read it at
generation time?

Thanks in advance,
      W
This transmission contains information that may be confidential and contain personal views which are not necessarily those of YouView TV Ltd. YouView TV Ltd (Co No:7308805) is a limited liability company registered in England and Wales with its registered address at YouView TV Ltd, 3rd Floor, 10 Lower Thames Street, London, EC3R 6YT. For details see our web site at http://www.youview.com


More information about the cmake-developers mailing list