CGAL with -std=c++11
Hi community,
I have a problem compiling a ROS package with CGAL and "-std=c++11" flag.
Here is a minimal CMakeLists.txt to reproduce the error:
cmake_minimum_required(VERSION 2.8.3)
project(cgal_cmake_flags)
find_package(catkin REQUIRED)
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} " -std=c++11")
find_package(CGAL REQUIRED COMPONENTS Core)
set(CGAL_DONT_OVERRIDE_CMAKE_FLAGS TRUE CACHE BOOL "Don't override flags")
message(CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS})
include(${CGAL_USE_FILE})
message(CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS})
During the cmake process, this line gets printed:
"-- USING CXXFLAGS = '-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -frounding-math; -std=c++11 -O3 -DNDEBUG'"
You will notice the semi-colon after -frounding-math. This causes big problems when compiling. I tried "catkin_make -DCGAL_DONT_OVERRIDE_CMAKE_FLAGS=TRUE" but it didn't help.
Does someone has experience setting c++11 standard and using CGAL with catkin?
Thanks a lot, Gaël
afaik ROS does not support c++11.
I didn't know that but I know that I already compiled some of my packages with c++11.
The current guideline for ROS packages is to not require C++11. It does not prevent packages to build with C++11 if they are aware that this might make them incompatible with platforms which do not support a C++11 compiler yet.