Usage of standard compile option variable undocumented
The current CXX standard flag found by CMake is available in the variable:
${CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION}
However, that does not seem to be documented anywhere, though it's been in all the 3.x series. For the ROOT project, the C++ standard flag that was used to compile ROOT is being written into a root-config
script, and would be better off if it could capture this variable rather than using -std=c++${CMAKE_CXX_STANDARD}
, which can be incorrect. Ideally this could be mentioned somewhere in the documentation so that it would not just be an internal detail. I would at the very least like a confirmation that it is a safe variable to use for C++11 and higher code.
Discussion here: https://github.com/root-project/root/pull/3411
Edited by Henry Schreiner