[cmake-developers] Feature Request: Modify CXX_STANDARD behavior for Xcode Generator: Starting Tips?

Jason Felds jafelds at gmail.com
Thu Jul 2 22:22:27 EDT 2015


Salutations. I right now use CXX_STANDARD and CXX_STANDARD_LIBRARY for some
test projects since I want to utilize smart pointers. As I am on a Mac, my
preferred IDE is Xcode (sometimes called XCode), so I generate Xcode
targets by default. I've noticed, however, that whenever I use CXX_STANDARD
and its companions, it places the -std=gnu++11 (or equivalent) calls in the
OTHER_CPLUSPLUSFLAGS attribute instead of the CLANG_CXX_LANGUAGE_STANDARD
attribute.

Here's my current knowledge of this code base to see what currently happens
and what needs to be done.

   - The source file Source/cmGlobalXCodeGenerator.cxx is what generates
   the Xcode file.
   - Lines 2272 to 2277 (assuming master branch) are where the
   OTHER_CPLUSPLUSFLAGS are written.
   - The flags are coming from either one of cflags[*li] or defFlags.
   defFlags is filled in via GetDefineFlags() within Source/cmMakefile.h,
   whereas cflags is filled in with the contents of gflags.
   - Doing a grep for `gnu++11` gives me either .rst files or .cmake files,
   but no .h or .cxx files.

I guess I'm still a little confused as to where I need to modify the Xcode
generator. My questions are thus the following:

   - Is there a proper source location where the standard is defined?
   - Which variable does it get set to: cflags or defFlags?
   - Is there a clean way to remove the std flag and place it in a more
   Apple friendly location, or would I have to do so?

Sincerely,
Jason Felds
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150702/f82a4961/attachment.html>


More information about the cmake-developers mailing list