Details

Branch blender2.8 was failing to compile because on Linux Mint/Ubuntu 14.04 the gcc version is 4.8. gcc 6.0 makes C++11 the default profile whereas 4.8 does not.
This fix helps force C++11 profile to be loaded. However this would lead to a conflict as Blender/master requires 4.2 as minimum.
This is my first commit, so please let me know if there is anything I need to add.

@Mike Erwin (merwin), can't think what exact change made C++11 mandatory in blender2.8 branch. But in any case the change does not look correct to me: _cxx11_init is already ON, meaning default value of WITH_CXX11 is ON. This could mean that either someone explicitly set WITH_CXX11 to OFF or that CMake got confused when switching branches.

In the first case we can't really do anything, that was a developer's choise (who knows if he forgot this flag from other branch or wanted to make blender2.8 compilable without C++11 by hacking it). In the second case not sure either we should force anything. Switching branches could confuse hell of a CMake and best way to deal with that would be either manually enabling WITH_CXX11 for master branch (as in, use cmake -DWITH_CXX11 ... for all branches) or to use separate compilation folder.

When/if we will switch to C++11 mandatory then we'll need to remove all related options instead of hardcoding them to ON.

Didn't we already decide 2 or 3 times to enable C++11 for blender2.8? This conversation is getting into policy decisions. Let's open up a task for C++11 migration — not rewriting old code, just enabling compiler support for new code. Or is there already a task for this?

I have no experience with C11's new features; C99 is just fine. But C++11 has major benefits that we can't use until & compiler support is enabled in the build system.

I might be late to the chat but _cxx11_init doesn't really enable C++11 support. Hence set(_cxx11_init ON) does not have its intended effect.

But that's besides the point since this has turned into a much larger conversation about enabling compiler support.

@Mike Erwin (merwin) - Would you suggest that I close this revision and will this conversation happen at a different spot? If that's the case what do we do about the blender2.8 branch currently not compiling? I agree with you about the merits of using C++11. It is fairly standard and stable now.

In the meanwhile I'll continue with immediate mode migration with this change on my local branch; one that will not be submitted.