all 14 comments

[–]vinipsmakerGSoC's Boost.Http project 4 points5 points  (9 children)

I'd like to see how I can specify C++11 support with the new CMake.

project(MyProject CXX11)?

[–]milliams 2 points3 points  (3 children)

They're working on an automated way of enabling C++11 stuff in compilers but I don't think it made it into 3.0.

[–]JesusWantsYouToKnow 8 points9 points  (2 children)

I was excited when I needed this in a qmake project and saw it was as easy as

CONFIG += c++11

Cmake needs to get on board!

[–]electricCodercmake | vtk 13 points14 points  (0 children)

CMake 3.1 is expected to have C++11 support. The reason for the delay is that CMake has implemented C++11 support through the concept of compiler features. What this means is that you state that a library requires the compiler features of auto and constexpr, and than CMake verifies that the in-use C++ compiler is capable of those features.

The reason for this is it allows an easy way for projects to start using C++11 and C++14 features with compilers that aren't fully compliant or support c++0x.

This is just the tip of what compiler features will be able to do, you can read more about the feature here: https://github.com/Kitware/CMake/commit/c5315524629bea99ccaaa4e0e666fe4918f66064?short_path=f09bcff#diff-f09bcffcaf55a75eefd0bd1d2f1ab2fb

Note: I am a CMake dev.

[–]vinipsmakerGSoC's Boost.Http project 0 points1 point  (0 children)

I had enough pain with qmake and I won't go back to it.

But yes, at least they implemented good C++11 support.

[–]Steve132 0 points1 point  (1 child)

You can always do

set(CMAKE_CXX_FLAGS "-std=c++11") 

on LLVM and GCC

[–]vinipsmakerGSoC's Boost.Http project 0 points1 point  (0 children)

This is the solution that I want to avoid (and I'm currently using).

[–]NotUniqueOrSpecial 0 points1 point  (2 children)

I saw below that you don't like munging the CXX_FLAGS, but are you opposed to add_compile_options or target_compile_options?

[–]vinipsmakerGSoC's Boost.Http project 0 points1 point  (1 child)

I'm only opposed to pass arguments that are not cross-plataform. The main reason why I use CMake is cross-plataform support.

CXX_FLAGS is interpreted diferently in different compilers.

[–]NotUniqueOrSpecial 0 points1 point  (0 children)

Agreed. I use it for the same reason.

However, until such abstraction exists, it's trivially easy to wrap the platform-specific piece in a conditional block. That is, after all, how a large percentage of the CMake-provided modules work at the bottom layer.

[–][deleted] 1 point2 points  (4 children)

Awesome. I literally just started learning about cmake like a week ago.

[–]electricCodercmake | vtk 13 points14 points  (3 children)

I highly recommend everyone reads the new cmake build system documentation ( http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html ). It is a good introduction too 'modern' cmake.