Fix export API detection (for assimp < 2.0.885)

It looks like this API was added in Assimp 2.0.885:
ae23c03bd9
This commit is contained in:
Scott K Logan 2014-02-05 23:48:00 -07:00
parent d0ecf85b53
commit 049aa4ef3e
2 changed files with 9 additions and 0 deletions

View File

@ -27,6 +27,9 @@ if( ASSIMP_FOUND )
if( NOT ${ASSIMP_VERSION} STRLESS "2.0.1150" )
add_definitions(-DASSIMP_UNIFIED_HEADER_NAMES)
endif()
if( NOT ${ASSIMP_VERSION} STRLESS "2.0.885" )
add_definitions(-DASSIMP_EXPORT_API)
endif()
include_directories(${ASSIMP_INCLUDE_DIRS})
link_directories(${ASSIMP_LIBRARY_DIRS})
else()

View File

@ -14,7 +14,9 @@
#include <assimp/scene.h>
#else
#include <assimp.hpp>
#if defined(ASSIMP_EXPORT_API)
#include <assimp/export.hpp>
#endif
#include <aiScene.h>
#include <aiPostProcess.h>
#endif
@ -67,6 +69,7 @@ os << "xyz: " << origin.position.x << " " << origin.position.y << " " << origin.
void assimp_file_export(std::string fname, std::string ofname,
std::string mesh_type = "collada") {
#if defined(ASSIMP_EXPORT_API)
if (fname.find("file://") == 0) {
fname.erase(0, strlen("file://"));
}
@ -100,6 +103,7 @@ void assimp_file_export(std::string fname, std::string ofname,
std::string str( "assimp error" );
std::cerr << ";; " << str << std::endl;
}
#endif
}
// assimp bounding box calculation
@ -593,7 +597,9 @@ int main(int argc, char** argv)
cerr << ";; Adding gazebo description" << endl;
}
if (vm.count("use_assimp_export")) {
#if defined(ASSIMP_EXPORT_API)
use_assimp_export = true;
#endif
cerr << ";; Use assimp export" << endl;
}
if (vm.count("original_inertia_rotation")) {