Hi all,

I’m writing a CMake file for a project that should be compiled both in Ubuntu 
and OS X.
I want to use eclipse as IDE, gcc and C++ 11.

I read different threads that suggest how to enable C++ 11 in eclipse.
According to them I included these lines in my CMake:

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")

if (${CMAKE_EXTRA_GENERATOR} MATCHES "Eclipse CDT4")
        set(CMAKE_CXX_COMPILER_ARG1 "-std=c++11" CACHE STRING "C++ version for 
eclipse" FORCE)
        set(CMAKE_ECLIPSE_VERSION "4.3" CACHE STRING "Eclipse version" FORCE)
endif (${CMAKE_EXTRA_GENERATOR} MATCHES "Eclipse CDT4”)

However, eclipse still set a wrong value for the symbol __cplusplus (199711L 
instead of 201103L I guess).
For this reason eclipse is not able to index C++ 11 features such as shared 
pointer.
Therefore I get a syntax error also if the code compiles.

Any idea on how can I address this issue?

Thanks,
Luca




-- 

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:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to