[CMake] How to pass a configuration file to CMake?

Petr Kmoch petr.kmoch at gmail.com
Mon Dec 21 07:25:53 EST 2015


Hi Cedric.

I have never used it myself, but I believe you're looking for CMake's
command-line option '-C <initial-cache>':
https://cmake.org/cmake/help/latest/manual/cmake.1.html

Petr

On Mon, Dec 21, 2015 at 1:12 PM, Cedric Doucet <cedric.doucet at inria.fr>
wrote:

>
> Hello,
>
> I would like to know if it's possible to pass a configuration file to
> CMake.
> I have to pass a lot of information to CMake and the resulting command
> line is very long to type.
> Would it be possible to create a file containing all needed definitions
> and pass it to CMake?
>
> For exemple, instead of typing
>
> cmake -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX=/home/me/there -D
> CMAKE_CXX_COMPILER=/usr/local/gcc/4.9.3/g++
>
> would it be possible to create a file containing
>
> CMAKE_BUILD_TYPE=Debug
> CMAKE_INSTALL_PREFIX=/home/me/there
> CMAKE_CXX_COMPILER=/usr/local/gcc/4.9.3/g++
>
> and pass it to CMake?
>
> Cédric
>
> --
>
> 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/20151221/bd688250/attachment.html>


More information about the CMake mailing list