Merge pull request #53 from cottsay/hydro-devel
Better feature detection for assimp version
This commit is contained in:
commit
cfd6c6a600
|
@ -24,9 +24,11 @@ if ( NOT ASSIMP_FOUND )
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if( ASSIMP_FOUND )
|
if( ASSIMP_FOUND )
|
||||||
if( ${ASSIMP_VERSION} STRGREATER "2.0.0" )
|
if( NOT ${ASSIMP_VERSION} VERSION_LESS "2.0.1150" )
|
||||||
set(IS_ASSIMP3 1)
|
add_definitions(-DASSIMP_UNIFIED_HEADER_NAMES)
|
||||||
add_definitions(-DIS_ASSIMP3)
|
endif()
|
||||||
|
if( NOT ${ASSIMP_VERSION} VERSION_LESS "2.0.885" )
|
||||||
|
add_definitions(-DASSIMP_EXPORT_API)
|
||||||
endif()
|
endif()
|
||||||
include_directories(${ASSIMP_INCLUDE_DIRS})
|
include_directories(${ASSIMP_INCLUDE_DIRS})
|
||||||
link_directories(${ASSIMP_LIBRARY_DIRS})
|
link_directories(${ASSIMP_LIBRARY_DIRS})
|
||||||
|
@ -38,7 +40,6 @@ else()
|
||||||
set(ASSIMP_CFLAGS_OTHER)
|
set(ASSIMP_CFLAGS_OTHER)
|
||||||
set(ASSIMP_LINK_FLAGS)
|
set(ASSIMP_LINK_FLAGS)
|
||||||
set(ASSIMP_INCLUDE_DIRS)
|
set(ASSIMP_INCLUDE_DIRS)
|
||||||
set(IS_ASSIMP3 0) # most likely not
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(COLLADA_DOM 2.3 COMPONENTS 1.5)
|
find_package(COLLADA_DOM 2.3 COMPONENTS 1.5)
|
||||||
|
|
|
@ -5,8 +5,7 @@
|
||||||
#include <collada_parser/collada_parser.h>
|
#include <collada_parser/collada_parser.h>
|
||||||
#include <urdf_parser/urdf_parser.h>
|
#include <urdf_parser/urdf_parser.h>
|
||||||
|
|
||||||
#if IS_ASSIMP3
|
#if defined(ASSIMP_UNIFIED_HEADER_NAMES)
|
||||||
// assimp 3 (assimp_devel)
|
|
||||||
#include <assimp/IOSystem.hpp>
|
#include <assimp/IOSystem.hpp>
|
||||||
#include <assimp/IOStream.hpp>
|
#include <assimp/IOStream.hpp>
|
||||||
#include <assimp/Importer.hpp>
|
#include <assimp/Importer.hpp>
|
||||||
|
@ -14,9 +13,10 @@
|
||||||
#include <assimp/postprocess.h>
|
#include <assimp/postprocess.h>
|
||||||
#include <assimp/scene.h>
|
#include <assimp/scene.h>
|
||||||
#else
|
#else
|
||||||
// assimp 2
|
|
||||||
#include <assimp.hpp>
|
#include <assimp.hpp>
|
||||||
//#include <assimp/export.hpp>
|
#if defined(ASSIMP_EXPORT_API)
|
||||||
|
#include <assimp/export.hpp>
|
||||||
|
#endif
|
||||||
#include <aiScene.h>
|
#include <aiScene.h>
|
||||||
#include <aiPostProcess.h>
|
#include <aiPostProcess.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -69,7 +69,7 @@ os << "xyz: " << origin.position.x << " " << origin.position.y << " " << origin.
|
||||||
|
|
||||||
void assimp_file_export(std::string fname, std::string ofname,
|
void assimp_file_export(std::string fname, std::string ofname,
|
||||||
std::string mesh_type = "collada") {
|
std::string mesh_type = "collada") {
|
||||||
#if IS_ASSIMP3
|
#if defined(ASSIMP_EXPORT_API)
|
||||||
if (fname.find("file://") == 0) {
|
if (fname.find("file://") == 0) {
|
||||||
fname.erase(0, strlen("file://"));
|
fname.erase(0, strlen("file://"));
|
||||||
}
|
}
|
||||||
|
@ -597,7 +597,7 @@ int main(int argc, char** argv)
|
||||||
cerr << ";; Adding gazebo description" << endl;
|
cerr << ";; Adding gazebo description" << endl;
|
||||||
}
|
}
|
||||||
if (vm.count("use_assimp_export")) {
|
if (vm.count("use_assimp_export")) {
|
||||||
#if IS_ASSIMP3
|
#if defined(ASSIMP_EXPORT_API)
|
||||||
use_assimp_export = true;
|
use_assimp_export = true;
|
||||||
#endif
|
#endif
|
||||||
cerr << ";; Use assimp export" << endl;
|
cerr << ";; Use assimp export" << endl;
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
#include <boost/scoped_ptr.hpp>
|
#include <boost/scoped_ptr.hpp>
|
||||||
|
|
||||||
#if defined(IS_ASSIMP3)
|
#if defined(ASSIMP_UNIFIED_HEADER_NAMES)
|
||||||
#include <assimp/scene.h>
|
#include <assimp/scene.h>
|
||||||
#include <assimp/LogStream.hpp>
|
#include <assimp/LogStream.hpp>
|
||||||
#include <assimp/DefaultLogger.hpp>
|
#include <assimp/DefaultLogger.hpp>
|
||||||
|
|
Loading…
Reference in New Issue