From b612d1ba9cf83d5c08a2899945170f585f13a2a6 Mon Sep 17 00:00:00 2001 From: Kei Okada Date: Thu, 17 Apr 2014 09:00:25 +0900 Subject: [PATCH] (collada_tools) update files for using jsk_common/assimp_devel (#20) --- collada_tools/CMakeLists.txt | 8 ++++++++ collada_tools/catkin.cmake | 14 +++++++++----- collada_tools/src/collada_to_urdf.cpp | 12 ++++++------ 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/collada_tools/CMakeLists.txt b/collada_tools/CMakeLists.txt index 5edaffbb4..00900bb58 100644 --- a/collada_tools/CMakeLists.txt +++ b/collada_tools/CMakeLists.txt @@ -22,6 +22,12 @@ pkg_check_modules(COLLADADOM collada15dom) include_directories(${COLLADADOM_INCLUDE_DIRS}) link_directories(${COLLADADOM_LIBRARY_DIRS}) +rosbuild_find_ros_package(assimp_devel) +set(ENV{PKG_CONFIG_PATH} ${assimp_devel_PACKAGE_PATH}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}) +pkg_check_modules(assimp assimp_devel REQUIRED) +include_directories(${assimp_INCLUDE_DIRS}) +link_directories(${assimp_LIBRARY_DIRS}) + #set the default path for built executables to the "bin" directory set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) #set the default path for built libraries to the "lib" directory @@ -46,3 +52,5 @@ rosbuild_add_link_flags(collada_to_graphviz -Wl,--no-as-needed ) rosbuild_add_executable(collada_to_urdf src/collada_to_urdf.cpp) rosbuild_link_boost(collada_to_urdf filesystem program_options) rosbuild_add_link_flags(collada_to_urdf -Wl,--no-as-needed ) +target_link_libraries(collada_to_urdf ${assimp_LIBRARIES}) + diff --git a/collada_tools/catkin.cmake b/collada_tools/catkin.cmake index 772fcc2d5..931fceb72 100644 --- a/collada_tools/catkin.cmake +++ b/collada_tools/catkin.cmake @@ -2,9 +2,9 @@ cmake_minimum_required(VERSION 2.8.3) project(collada_tools) if($ENV{ROS_DISTRO} STREQUAL "groovy") - find_package(catkin REQUIRED COMPONENTS roscpp urdf_parser assimp_devel urdf collada_parser) + find_package(catkin REQUIRED COMPONENTS roscpp urdf_parser urdf collada_parser) else() - find_package(catkin REQUIRED COMPONENTS roscpp urdf_parser_plugin assimp_devel urdf collada_parser) + find_package(catkin REQUIRED COMPONENTS roscpp urdf_parser_plugin urdf collada_parser) endif() find_package(Boost REQUIRED COMPONENTS filesystem program_options) @@ -14,13 +14,17 @@ pkg_check_modules(COLLADADOM collada-dom-150) include_directories(${COLLADADOM_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS}) link_directories(${COLLADADOM_LIBRARY_DIRS}) +pkg_check_modules(assimp_devel assimp_devel REQUIRED) +include_directories(${assimp_devel_INCLUDE_DIRS}) +link_directories(${assimp_devel_LIBRARY_DIRS}) + + # check_function_exists(mkstemps HAVE_MKSTEMPS) # if( HAVE_MKSTEMPS ) # add_definitions("-DHAVE_MKSTEMPS") # endif() catkin_package( - CATKIN_DEPENDS assimp_devel ) set(SOURCE_FILES @@ -41,8 +45,8 @@ add_dependencies(collada_to_graphviz libassimp) add_executable(collada_to_urdf src/collada_to_urdf.cpp) set_target_properties(collada_to_urdf PROPERTIES LINK_FLAGS "-Wl,--no-as-needed") -target_link_libraries(collada_to_urdf ${catkin_LIBRARIES} ${Boost_LIBRARIES}) -add_dependencies(collada_to_urdf libassimp) +target_link_libraries(collada_to_urdf ${catkin_LIBRARIES} ${Boost_LIBRARIES} ${assimp_devel_LIBRARIES}) +add_dependencies(collada_to_urdf libassimp_devel) install(TARGETS collada_to_urdf collada_to_graphviz collada_gazebo_gen RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} diff --git a/collada_tools/src/collada_to_urdf.cpp b/collada_tools/src/collada_to_urdf.cpp index ae45d5945..975cef5c5 100644 --- a/collada_tools/src/collada_to_urdf.cpp +++ b/collada_tools/src/collada_to_urdf.cpp @@ -5,12 +5,12 @@ #include "urdf_parser/urdf_parser.h" // assimp 3 (assimp_devel) -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include