Re: [cmake-developers] External projects & library dependencies

2017-04-11 Thread Wouter Klouwen

Hi Brad,

thanks for taking the time to reply.

On 11/04/17 18:00, Brad King wrote:

On 04/11/2017 12:33 PM, Wouter Klouwen wrote:

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?


Make your outer project a "superbuild" that does not compile anything
itself but instead just uses ExternalProject_Add to build everything
else in dependency order.  That way each project won't configure until
all its dependencies are built.


Unfortunately this isn't really an option for us. There's a non trivial
amount of third party packages that take a non trivial amount of time to
compile.
Waiting for all of these to compile while not yet starting on our own
projects would create a very long critical path before the build could
fan out for all targets. This would have a detrimental impact on our
build performance.

I appreciate it's not a usual problem as this is for an embedded
platform where we have to cross build everything from scratch.

Thanks,
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
--

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


Re: [cmake-developers] External projects & library dependencies

2017-04-11 Thread Brad King
On 04/11/2017 12:33 PM, Wouter Klouwen wrote:
> 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?

Make your outer project a "superbuild" that does not compile anything
itself but instead just uses ExternalProject_Add to build everything
else in dependency order.  That way each project won't configure until
all its dependencies are built.

-Brad

-- 

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