Discussion:
[CMake] What is --build-two-config good for
Torsten Robitzki
2018-12-06 06:05:24 UTC
Permalink
Hello,
can someone of you tell me, what the purpose of the CTest —build-two-config command line option is? The documentation says, that it is part of the CTest Build and Test Mode and that it will cause CTest to run CMake twice. I’ve checked the code and yes, it does exactly this.

But why? What could be the reason to run CMake twice, when running CMake in a test from CTest?

Best regards,

Torsten
Robert Maynard via CMake
2018-12-06 14:26:49 UTC
Permalink
It is possible to have CMake projects where an initial configuration of the
project is insufficient for it to be in a valid state. This is generally
caused by a project which evaluates variables before they exist and saved
into the cache. By running CMake a second time for these projects the
evaluation works 'as intended' at the build is the correct state.
Post by Torsten Robitzki
Hello,
can someone of you tell me, what the purpose of the CTest
—build-two-config command line option is? The documentation says, that it
is part of the CTest Build and Test Mode and that it will cause CTest to
run CMake twice. I’ve checked the code and yes, it does exactly this.
But why? What could be the reason to run CMake twice, when running CMake
in a test from CTest?
Best regards,
Torsten
--
Powered by www.kitware.com
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more
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
https://cmake.org/mailman/listinfo/cmake
T***@Robitzki.de
2018-12-06 16:45:39 UTC
Permalink
Hi Robert,
It is possible to have CMake projects where an initial configuration of the project is insufficient for it to be in a valid state. This is generally caused by a project which evaluates variables before they exist and saved into the cache. By running CMake a second time for these projects the evaluation works ‚as intended' at the build is the correct state.
thanks for the explanation!

regards,

Torsten

Loading...