Skip to content

Commit

Permalink
(eus_assimp) update files for using assimp_devel in jsk_common (jsk-r…
Browse files Browse the repository at this point in the history
  • Loading branch information
YoheiKakiuchi authored and k-okada committed Apr 17, 2014
1 parent 76e9635 commit dbdbba8
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 16 deletions.
17 changes: 15 additions & 2 deletions eus_assimp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
if(NOT USE_ROSBUILD)
include(catkin.cmake)
return()
endif()
cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)

Expand All @@ -23,12 +27,16 @@ set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
include (FindPkgConfig)
pkg_check_modules (SDLIMG SDL_image)

rosbuild_find_ros_package(assimp_devel)
set(ENV{PKG_CONFIG_PATH} ${assimp_devel_PACKAGE_PATH}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH})
pkg_check_modules(assimpdevel assimp_devel REQUIRED)

#common commands for building c++ executables and libraries
rosbuild_find_ros_package(euslisp)
# for using convex decomposition in openrave/3rdparty
rosbuild_find_ros_package(openrave)
include_directories(/usr/include /usr/X11R6/include ${euslisp_PACKAGE_PATH}/jskeus/eus/include ${openrave_PACKAGE_PATH}/openrave_git/3rdparty/convexdecomposition ${SDLIMG_INCLUDE_DIRS})
link_directories ("${openrave_PACKAGE_PATH}/build/3rdparty/convexdecomposition")
include_directories(/usr/include /usr/X11R6/include ${euslisp_PACKAGE_PATH}/jskeus/eus/include ${openrave_PACKAGE_PATH}/openrave_git/3rdparty/convexdecomposition ${SDLIMG_INCLUDE_DIRS} ${assimpdevel_INCLUDE_DIRS})
link_directories ("${openrave_PACKAGE_PATH}/build/3rdparty/convexdecomposition" ${assimpdevel_LIBRARY_DIRS})

rosbuild_add_library(eus_assimp src/eus_assimp.cpp)
#rosbuild_add_boost_directories()
Expand All @@ -38,6 +46,7 @@ if(EXISTS ${openrave_PACKAGE_PATH}/build/3rdparty/convexdecomposition/libconvexd
target_link_libraries(eus_assimp convexdecomposition)
add_definitions(-DCOMPILE_CONVEX_DECOMPOSITION=1)
endif()
target_link_libraries(eus_assimp ${assimpdevel_LIBRARIES})

if(SDLIMG_FOUND)
# message(STATUS "SDL_image found")
Expand All @@ -58,3 +67,7 @@ endif()

rosbuild_add_compile_flags(eus_assimp ${COMPILE_FLAGS})
set_target_properties(eus_assimp PROPERTIES PREFIX "" SUFFIX ".so")

add_dependencies(eus_assimp libassimp_devel)

set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/euslisp)
3 changes: 2 additions & 1 deletion eus_assimp/Makefile
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
include $(shell rospack find mk)/cmake.mk
EXTRA_CMAKE_FLAGS = -DUSE_ROSBUILD:BOOL=1
include $(shell rospack find mk)/cmake.mk
62 changes: 62 additions & 0 deletions eus_assimp/catkin.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# http://ros.org/doc/groovy/api/catkin/html/user_guide/supposed.html
cmake_minimum_required(VERSION 2.8.3)
project(eus_assimp)

# Load catkin and all dependencies required for this package
# TODO: remove all from COMPONENTS that are not catkin packages.
find_package(catkin REQUIRED COMPONENTS euslisp)

set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${CATKIN_DEVEL_PREFIX}/lib/pkgconfig")

find_package(PkgConfig)
pkg_check_modules(assimpdevel assimp_devel REQUIRED)
# CATKIN_MIGRATION: removed during catkin migration
# rosbuild_add_boost_directories()
if(EXISTS ${euslisp_SOURCE_DIR}/jskeus)
set(euslisp_PACKAGE_PATH ${euslisp_SOURCE_DIR})
else()
set(euslisp_PACKAGE_PATH ${euslisp_PREFIX}/share/euslisp)
endif()
message("-- Set euslisp_PACKAGE_PATH to ${euslisp_PACKAGE_PATH}")
set(euslisp_INCLUDE_DIRS ${euslisp_PACKAGE_PATH}/jskeus/eus/include)
message("-- Set euslisp_INCLUDE_DIRS to ${euslisp_INCLUDE_DIRS}")
include_directories(/usr/include /usr/X11R6/include ${euslisp_INCLUDE_DIRS} ${assimpdevel_INCLUDE_DIRS})
link_directories(${assimpdevel_LIBRARY_DIRS})
add_library(eus_assimp src/eus_assimp.cpp)

target_link_libraries(eus_assimp ${assimpdevel_LIBRARIES})
set_target_properties(eus_assimp PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/euslisp)
add_dependencies(eus_assimp libassimp_devel)

# compile flags
add_definitions(-O2 -Wno-write-strings -Wno-comment)
add_definitions(-Di486 -DLinux -D_REENTRANT -DVERSION='\"9.00\"' -DTHREADED -DPTHREAD -DX11R6_1)
add_definitions('-DREPOVERSION="\\"${REPOVERSION}\\""')
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES amd64* OR
${CMAKE_SYSTEM_PROCESSOR} MATCHES x86_64* )
add_definitions(-Dx86_64)
else()
add_definitions(-Di486)
endif()

if(${CMAKE_SYSTEM_NAME} MATCHES Darwin)
add_definitions(-Dx86_64)
set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS} -flat_namespace -undefined suppress")
endif()

set_target_properties(eus_assimp PROPERTIES PREFIX "" SUFFIX ".so")

## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
DEPENDS
CATKIN_DEPENDS # euslisp TODO
INCLUDE_DIRS # TODO include
LIBRARIES assimp_devel # TODO
)

# install
install(DIRECTORY euslisp
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
USE_SOURCE_PERMISSIONS)
2 changes: 1 addition & 1 deletion eus_assimp/euslisp/eus-assimp.l
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
;;
;; assimp mesh reader for euslisp
;;
(require :eus-assimp "package://eus_assimp/lib/eus_assimp.so")
(require :eus-assimp "package://eus_assimp/euslisp/eus_assimp.so")

(defconstant *aiProcess_CalcTangentSpace* #x1)
(defconstant *aiProcess_JoinIdenticalVertices* #x2)
Expand Down
28 changes: 28 additions & 0 deletions eus_assimp/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<package>
<name>eus_assimp</name>
<version>0.1.0</version>
<description>eus_assimp</description>

<maintainer email="[email protected]">Yohei Kakiuchi</maintainer>

<license>BSD</license>

<!-- <url type="bugtracker"></url> -->

<author email="[email protected]">Yohei Kakiuchi</author>

<buildtool_depend>catkin</buildtool_depend>

<!--build_depend>roseus</build_depend-->
<build_depend>assimp_devel</build_depend>

<run_depend>roseus</run_depend>
<run_depend>assimp_devel</run_depend>

<!-- <test_depend>euslisp</test_depend> -->
<!-- <test_depend>roseus</test_depend> -->

<export>
<rosdoc config="rosdoc.yaml"/>
</export>
</package>
17 changes: 5 additions & 12 deletions eus_assimp/src/eus_assimp.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
#if 0
// assimp 2
#include <assimp/assimp.hpp>
#include <assimp/aiScene.h>
#include <assimp/aiPostProcess.h>
#endif

// assimp 3
#include <assimp/Importer.hpp>
#include <assimp/Exporter.hpp>
#include <assimp/postprocess.h>
#include <assimp/scene.h>
// assimp_devel
#include <Importer.hpp>
#include <Exporter.hpp>
#include <postprocess.h>
#include <scene.h>

// convex decomposition
#if COMPILE_CONVEX_DECOMPOSITION
Expand Down

0 comments on commit dbdbba8

Please sign in to comment.