[CMake] Is there a way to obtain the current compiler standard flag?

Robert Maynard robert.maynard at kitware.com
Wed May 30 15:38:48 EDT 2018


I am pretty sure you currently can't extract the compile flag information.
This would be an enhancement and would have to be done as a generator
expression.
On Tue, May 29, 2018 at 5:37 PM Chris Green <greenc at fnal.gov> wrote:

> Hi,

> We have to use a utility (Root's rootcling/genreflex tool) as part of a
> custom command to parse some C++ headers. We are in the process of
> migrating from using raw -std= additions to compilation flags to use of
> CMAKE_CXX_STANDARD and friends. We need to pass the correct compiler
> flag to the invocation of rootcling in order to ensure headers are
> parsed correctly based on the CXX_STANDARD and CXX_EXTENSIONS
> properties, but we don't appear to be able to discover what it is. We
> could generate it from scratch like we did before, but it seems like it
> would be preferable to be able to pass it to the command as already
> calculated by CMake, perhaps via a generator expression.

> Is there some way to do this already that I missed, or would this be an
> enhancement?

> Thanks,

> Chris.

> --

> 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:
> https://cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list