> ---------- Forwarded message ----------
> From: Robert Dailey <rcdailey.li...@gmail.com>
> To: CMake <cmake@cmake.org>
> Cc:
> Date: Sun, 16 Aug 2015 08:32:08 -0500
> Subject: [CMake] How to depend on external cmake projects?
>


> There are certain repositories on Github I'd like to pull in as a
> dependency. These repositories already use CMake to build their source
> code. Based on personal experience and reading material online, there
> are a couple of different options:
>

In addition to the options you listed (omitted here), since the projects
you want to pull in are CMake-based, another choice is to simply add them
to your project directly via add_subdirectory(). This can be convenient for
linking against the 3rd party libraries, etc. since CMake will already know
about the 3rd party targets and CMake will also build them with the same
settings as the rest of your build. If you want, you can use
ExternalProject to download the source code at configure time, a technique
I recently mentioned on this list. You can find the article about that
approach (with Google Test as the example) here:

http://crascit.com/2015/07/25/cmake-gtest/


-- 
Craig Scott
Melbourne, Australia
http://crascit.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

Reply via email to