[CMake] Provide configuration settings for users

Elizabeth A. Fischer elizabeth.fischer at columbia.edu
Tue Jun 14 10:09:06 EDT 2016


Cedric,

I would highly recommend an auto-builder such as Spack as a good way to
have a system that automatically downloads and installs dependencies for
your software.  My software requires about 50 dependencies (once recursive
dependencies are counted), and I've successfully used Spack to have others
install it.  See instructions for installing my software stack using Spack
at:

   https://github.com/citibeth/icebin

(Most of these instructions are for bootstrapping Spack on old machines,
and not directly for my particular software).

This approach is a lot easier for you and your users, and more flexible to
boot:

 1. You don't have to deal with advanced/esoteric features like
ExternalProject, CMakeList templates, etc.

 2. It doesn't matter what build system your dependencies were written
with.  (I've heard of people writing CMake builds for all their
dependencies.  As much as I like CMake, that seems like a painful way to
proceed).

 3. Consider what would happen if every project used ExternalProject for
its dependencies: we'd be unable to link projects together as soon as they
share a sub-dependency, since every project would be building its own.  You
really want to build a coherent software DAG (Directed Acyclic Graph) at a
level ABOVE the single-project level, in order to avoid duplicate /
conflicting packages in your build.  For that reason, the project-building
level (CMake) is fundamentally the wrong place to do this.  It should be
done by auto-builders on top of the project level (Spack, EasyBuild,
MacPorts, Gentoo Portage, etc).

-- Elizabeth



On Tue, Jun 14, 2016 at 6:28 AM, Cedric Doucet <cedric.doucet at inria.fr>
wrote:

>
> Hello,
>
> is there a native way to provide configuration settings for the users of a
> software?
>
> For example, I develop a software which depends on several 3rd party
> libraries which are automatically downloaded and installed with the
> ExternalProject module.
> My CMake configuration scripts are written so as to handle these 3rd party
> libraries.
> During installation of the software, header files and libraries are copied
> to the destination directory but (of course) without their 3rd party
> dependencies.
>
> Therefore, if a user wants to use my software, he has to handle these 3rd
> party libraries during compilation and linking steps.
> Depending on the skills of the user, it may be difficult to achieve it.
>
> I would like to know if there exists a native way of providing sufficient
> configuration information so that users do not have to handle these
> libraries.
> For the moment, I provide a CMakeLists template but I wonder if it's the
> best possible solution.
>
> Best regards,
>
> Cédric Doucet
>
> --
>
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160614/afee4ba0/attachment.html>


More information about the CMake mailing list