compile collada_urdf with c++11 standard (redux) (#145)
* compile collada_urdf with c++11 standard as the gnu-specific keyword "typeof" is used in the code, the gnu 11 standard has to be specified. cmake_minimum_required increased to have add_compile_options around. * use decltype and check for flag before passing it * disable some warnings and fix cxx flag check
This commit is contained in:
parent
2dfb8a2606
commit
dbd8907ce1
|
@ -1,4 +1,4 @@
|
|||
cmake_minimum_required(VERSION 2.8.3)
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
project(collada_urdf)
|
||||
|
||||
find_package(catkin REQUIRED COMPONENTS angles collada_parser resource_retriever urdf geometric_shapes tf cmake_modules)
|
||||
|
@ -10,6 +10,12 @@ catkin_package(
|
|||
INCLUDE_DIRS include
|
||||
DEPENDS angles collada_parser resource_retriever urdf geometric_shapes tf)
|
||||
|
||||
include(CheckCXXCompilerFlag)
|
||||
check_cxx_compiler_flag(-std=c++11 HAS_STD_CPP11_FLAG)
|
||||
if(HAS_STD_CPP11_FLAG)
|
||||
add_compile_options(-std=c++11)
|
||||
endif()
|
||||
|
||||
include_directories(include)
|
||||
|
||||
find_package(assimp QUIET)
|
||||
|
|
|
@ -39,7 +39,14 @@
|
|||
|
||||
#include <string>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#ifndef _WIN32
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#include <dae.h>
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
#include "urdf/model.h"
|
||||
|
||||
namespace collada_urdf {
|
||||
|
|
|
@ -40,6 +40,9 @@
|
|||
#include <vector>
|
||||
#include <list>
|
||||
|
||||
#ifndef _WIN32
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#include <dae.h>
|
||||
#include <dae/daeDocument.h>
|
||||
#include <dae/daeErrorHandler.h>
|
||||
|
@ -49,6 +52,9 @@
|
|||
#include <dom/domElements.h>
|
||||
#include <dom/domTriangles.h>
|
||||
#include <dom/domTypes.h>
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
#include <resource_retriever/retriever.h>
|
||||
#include <urdf/model.h>
|
||||
#include <urdf_model/pose.h>
|
||||
|
@ -82,7 +88,7 @@
|
|||
#include <geometric_shapes/shapes.h>
|
||||
#include <geometric_shapes/mesh_operations.h>
|
||||
|
||||
#define FOREACH(it, v) for(typeof((v).begin())it = (v).begin(); it != (v).end(); (it)++)
|
||||
#define FOREACH(it, v) for(decltype((v).begin()) it = (v).begin(); it != (v).end(); (it)++)
|
||||
#define FOREACHC FOREACH
|
||||
|
||||
using namespace std;
|
||||
|
|
|
@ -34,7 +34,13 @@
|
|||
|
||||
/* Author: Tim Field */
|
||||
|
||||
#ifndef _WIN32
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#include "collada_urdf/collada_urdf.h"
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
#include <ros/ros.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
|
|
Loading…
Reference in New Issue