On 2018-01-04 05:09+0300 Dave Milter wrote:

Hello,

If there is some libfoo that I want to use in my project,
and this libfoo has it's own CMakeLists.txt I have 3 options to deal
with such external dependency:

a) Treat it like every other external dependency and write cmake code
 like FindLibFoo.cmake to find libfoo on file system.

b)Include this project as git submodule and use ExternalProject to
invoke `cmake` and `cmake --build`

c)Include this project as git submodule and use add_subdirectory(libfoo)

Or

 d) Use a config-file package approach (the preferred modern
 alternative to the find-file package approach used in (a)).  See
 <https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html>
 for details concerning config-file packages. Of course, this option
 assumes that external software's CMake-based build system has been
 developed to the point of creating a config-file package. However, if
 it has a CMake-based build system already that is just lacking such a
 package, it is straightforward to implement such a package (from my
 experience doing that for several different projects and also from
 the above URL).

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________
--

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:
https://cmake.org/mailman/listinfo/cmake

Reply via email to