try_compile: Provide central logging for all try_compile calls
Initially inquired here https://discourse.cmake.org/t/central-logging-of-all-source-and-project-based-try-compile-calls-into-a-file/1720
It would be useful to provide central logging of all '
try_compile-like' calls that would include:
- exact cmake arguments used during their configuration
- output of the cmake configuration
- verbose stdout and stderr output of building the projects
This would include both source-based and project-based
I mention 'try-compile-like' because it would be great if it also included the output of the initial language detection that CMake does at the beginning of each project.
When configuring a complex project, some
try_compile calls might fail. Troubleshooting them can be complicated, especially if you're a new CMake user. Having a central location can make that considerably easier.
As mentioned in the initial link, the current implementation of
CMakeFiles/CMakeOutput.log are not sufficient.
A bit of brainstorming, potential forms the the logging could take:
- one single file
- multiple files
CMakeTryCompileCallsLog.txtfor the cmake commands,
CMakeTryCompileConfigureLog.txtfor the configure output,
CMakeTryCompileBuildLog.txtfor the stdout/stderr of the build.
- something in-between