[CMake] What is the best way to handle Boost dependencies in a package config file

Michi Henning michi.henning at canonical.com
Wed Jan 27 01:54:41 EST 2016


We use this, which works fine for me on Ubuntu:

find_package(Boost COMPONENTS system filesystem regex serialization thread log REQUIRED)

Cheers,

Michi.

> On 27 Jan 2016, at 12:54 , Johnson, Matt (GE Healthcare) <Matthew.Johnson1 at med.ge.com> wrote:
> 
> I like package config files.  I want to use more of them.  However, I have a dependency on boost.  While boost has a Find module, it doesn't have a package config file.  I'm not going to be able to depend on the users of my package building boost via cmake (also, is that still an active thing?).
> 
> It seems like the best I could hope for is to generate the package config file, then hack it up to deal with the boost stuff.  Has anyone already solved this problem or have any tips?  I found this Hunter package manager (https://github.com/ruslo/hunter), but it seems a bit heavyweight when all I want is boost.  Also, I can't have my build system going out and downloading the packages - they all have to come from an internal source.  
> 
> Thanks,
> Matt
> 
> 
> -- 
> 
> 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



More information about the CMake mailing list