diff --git a/CMakeLists.txt b/CMakeLists.txt index 67fd67f94..5105e3a1f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,7 +39,50 @@ SET(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required cmake_minimum_required( VERSION 2.8 ) PROJECT( Assimp ) -OPTION(BUILD_SHARED_LIBS "Build package with shared libraries." ON) +# All supported options ############################################### +OPTION( BUILD_SHARED_LIBS + "Build package with shared libraries." + ON +) +OPTION( ASSIMP_DOUBLE_PRECISION + "Set to ON to enable double precision processing" + OFF +) +OPTION( ASSIMP_OPT_BUILD_PACKAGES + "Set to ON to generate CPack configuration files and packaging targets" + OFF +) +OPTION( ASSIMP_ANDROID_JNIIOSYSTEM + "Android JNI IOSystem support is active" + OFF +) +OPTION( ASSIMP_NO_EXPORT + "Disable Assimp's export functionality." + OFF +) +OPTION( ASSIMP_BUILD_ZLIB + "Build your own zlib" + OFF +) +option( ASSIMP_BUILD_ASSIMP_TOOLS + "If the supplementary tools for Assimp are built in addition to the library." + ON +) +option ( ASSIMP_BUILD_SAMPLES + "If the official samples are built as well (needs Glut)." + OFF +) +OPTION ( ASSIMP_BUILD_TESTS + "If the test suite for Assimp is built in addition to the library." + ON +) +IF(MSVC) + OPTION( ASSIMP_INSTALL_PDB + "Install MSVC debug files." + ON + ) +ENDIF(MSVC) + IF(NOT BUILD_SHARED_LIBS) SET(LINK_SEARCH_START_STATIC TRUE) ENDIF(NOT BUILD_SHARED_LIBS) @@ -80,18 +123,12 @@ IF(NOT GIT_COMMIT_HASH) SET(GIT_COMMIT_HASH 0) ENDIF(NOT GIT_COMMIT_HASH) -OPTION(ASSIMP_DOUBLE_PRECISION - "Set to ON to enable double precision processing" - OFF -) - IF(ASSIMP_DOUBLE_PRECISION) ADD_DEFINITIONS(-DAI_DOUBLE_PRECISION) ENDIF(ASSIMP_DOUBLE_PRECISION) configure_file( ${CMAKE_CURRENT_LIST_DIR}/revision.h.in -# ${CMAKE_CURRENT_SOURCE_DIR}/revision.h.in ${CMAKE_CURRENT_BINARY_DIR}/revision.h ) @@ -106,23 +143,28 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR}/include ) -OPTION(ASSIMP_OPT_BUILD_PACKAGES "Set to ON to generate CPack configuration files and packaging targets" OFF) SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules" ) SET(LIBASSIMP_COMPONENT "libassimp${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}.${ASSIMP_VERSION_PATCH}" ) SET(LIBASSIMP-DEV_COMPONENT "libassimp${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}.${ASSIMP_VERSION_PATCH}-dev" ) SET(CPACK_COMPONENTS_ALL assimp-bin ${LIBASSIMP_COMPONENT} ${LIBASSIMP-DEV_COMPONENT} assimp-dev) SET(ASSIMP_LIBRARY_SUFFIX "" CACHE STRING "Suffix to append to library names") -OPTION(ASSIMP_ANDROID_JNIIOSYSTEM "Android JNI IOSystem support is active" OFF) - # Workaround to be able to deal with compiler bug "Too many sections" with mingw. IF( CMAKE_COMPILER_IS_MINGW ) ADD_DEFINITIONS(-DASSIMP_BUILD_NO_IFC_IMPORTER ) ENDIF() +# Ensure that we do not run into issues like http://www.tcm.phy.cam.ac.uk/sw/inodes64.html on 32 bit linux +IF( UNIX ) + IF ( CMAKE_SIZEOF_VOID_P EQUAL 4) # only necessary for 32-bit linux + ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64 ) + ENDIF() +ENDIF() + IF((CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) AND NOT CMAKE_COMPILER_IS_MINGW) IF (BUILD_SHARED_LIBS AND CMAKE_SIZEOF_VOID_P EQUAL 8) # -fPIC is only required for shared libs on 64 bit SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") ENDIF() # hide all not-exported symbols SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -Wall -std=c++0x" ) @@ -171,8 +213,6 @@ IF (NOT TARGET uninstall) add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") ENDIF() - - # cmake configuration files configure_file("${CMAKE_CURRENT_SOURCE_DIR}/assimp-config.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config.cmake" @ONLY IMMEDIATE) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/assimp-config-version.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config-version.cmake" @ONLY IMMEDIATE) @@ -180,22 +220,12 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/assimp-config.cmake" "${C FIND_PACKAGE( DirectX ) -OPTION ( ASSIMP_NO_EXPORT - "Disable Assimp's export functionality." - OFF -) - IF( CMAKE_COMPILER_IS_GNUCXX ) SET(LIBSTDC++_LIBRARIES -lstdc++) ENDIF( CMAKE_COMPILER_IS_GNUCXX ) # Search for external dependencies, and build them from source if not found # Search for zlib -OPTION(ASSIMP_BUILD_ZLIB - "Build your own zlib" - OFF -) - IF ( NOT ASSIMP_BUILD_ZLIB ) find_package(ZLIB) ENDIF( NOT ASSIMP_BUILD_ZLIB ) @@ -293,10 +323,6 @@ ENDIF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER) ADD_SUBDIRECTORY( code/ ) -option ( ASSIMP_BUILD_ASSIMP_TOOLS - "If the supplementary tools for Assimp are built in addition to the library." - ON -) IF ( ASSIMP_BUILD_ASSIMP_TOOLS ) IF ( WIN32 ) option ( ASSIMP_BUILD_ASSIMP_VIEW "If the Assimp view tool is built. (requires DirectX)" ${DirectX_FOUND} ) @@ -306,12 +332,34 @@ IF ( ASSIMP_BUILD_ASSIMP_TOOLS ) ENDIF ( WIN32 ) ADD_SUBDIRECTORY( tools/assimp_cmd/ ) + + # Check dependencies for assimp_qt_viewer. + # Why here? Maybe user do not want Qt viewer and have no Qt. + # Why assimp_qt_viewer/CMakeLists.txt still contain similar check? + # Because viewer can be build independently of Assimp. + FIND_PACKAGE(Qt4 QUIET) + FIND_PACKAGE(DevIL QUIET) + FIND_PACKAGE(OpenGL QUIET) + IF ( Qt4_FOUND AND IL_FOUND AND OPENGL_FOUND) + ADD_SUBDIRECTORY( tools/assimp_qt_viewer/ ) + ELSE() + SET ( ASSIMP_QT_VIEWER_DEPENDENCIES "") + IF (NOT Qt4_FOUND) + SET ( ASSIMP_QT_VIEWER_DEPENDENCIES "${ASSIMP_QT_VIEWER_DEPENDENCIES} Qt4") + ENDIF (NOT Qt4_FOUND) + + IF (NOT IL_FOUND) + SET ( ASSIMP_QT_VIEWER_DEPENDENCIES "${ASSIMP_QT_VIEWER_DEPENDENCIES} DevIL") + ENDIF (NOT IL_FOUND) + + IF (NOT OPENGL_FOUND) + SET ( ASSIMP_QT_VIEWER_DEPENDENCIES "${ASSIMP_QT_VIEWER_DEPENDENCIES} OpengGL") + ENDIF (NOT OPENGL_FOUND) + + MESSAGE (WARNING "Build of assimp_qt_viewer is disabled. Unsatisfied dendencies: ${ASSIMP_QT_VIEWER_DEPENDENCIES}") + ENDIF ( Qt4_FOUND AND IL_FOUND AND OPENGL_FOUND) ENDIF ( ASSIMP_BUILD_ASSIMP_TOOLS ) -option ( ASSIMP_BUILD_SAMPLES - "If the official samples are built as well (needs Glut)." - OFF -) IF ( ASSIMP_BUILD_SAMPLES) IF ( WIN32 ) @@ -320,22 +368,10 @@ IF ( ASSIMP_BUILD_SAMPLES) ADD_SUBDIRECTORY( samples/SimpleOpenGL/ ) ENDIF ( ASSIMP_BUILD_SAMPLES ) -OPTION ( ASSIMP_BUILD_TESTS - "If the test suite for Assimp is built in addition to the library." - ON -) - IF ( ASSIMP_BUILD_TESTS ) ADD_SUBDIRECTORY( test/ ) ENDIF ( ASSIMP_BUILD_TESTS ) -IF(MSVC) - OPTION ( ASSIMP_INSTALL_PDB - "Install MSVC debug files." - ON - ) -ENDIF(MSVC) - # Generate a pkg-config .pc for the Assimp library. CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/assimp.pc.in" "${PROJECT_BINARY_DIR}/assimp.pc" @ONLY ) INSTALL( FILES "${PROJECT_BINARY_DIR}/assimp.pc" DESTINATION ${ASSIMP_LIB_INSTALL_DIR}/pkgconfig/ COMPONENT ${LIBASSIMP-DEV_COMPONENT}) diff --git a/CREDITS b/CREDITS index 9186c092e..1cfe4f640 100644 --- a/CREDITS +++ b/CREDITS @@ -7,13 +7,13 @@ The following is a non-exhaustive list of all constributors over the years. If you think your name should be listed here, drop us a line and we'll add you. - Alexander Gessler, -3DS-, BLEND-, ASE-, DXF-, HMP-, MDL-, MD2-, MD3-, MD5-, MDC-, NFF-, PLY-, STL-, RAW-, OFF-, MS3D-, Q3D- and LWO-Loader, Assimp-Viewer, assimp-cmd, -noboost, Website (Admin and Design). +3DS-, BLEND-, ASE-, DXF-, HMP-, MDL-, MD2-, MD3-, MD5-, MDC-, NFF-, PLY-, STL-, RAW-, OFF-, MS3D-, Q3D- and LWO-Loader, Assimp-Viewer, assimp-cmd, -noboost, Website (Design). - Thomas Schulze, X-, Collada-, BVH-Loader, Postprocessing framework. Data structure & Interface design, documentation. - Kim Kulling, -Obj-Loader, Logging system, Scons-build environment, CMake build environment, Linux build. +Obj-, Q3BSD-, OpenGEX-Loader, Logging system, CMake-build-environment, Linux-build, Website ( Admin ), Coverity ( Admin ), Glitter ( Admin ). - R.Schmidt, Linux build, eclipse support. diff --git a/Readme.md b/Readme.md index e75e9eca1..d91f290fa 100644 --- a/Readme.md +++ b/Readme.md @@ -14,7 +14,6 @@ Coverity Coverity Scan Build Status -Gitter [![Join the chat at https://gitter.im/assimp/assimp](https://badges.gitter.im/assimp/assimp.svg)](https://gitter.im/assimp/assimp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
__[open3mod](https://github.com/acgessler/open3mod) is a powerful 3D model viewer based on Assimp's import and export abilities.__ @@ -117,8 +116,7 @@ For development discussions, there is also a (very low-volume) mailing list, _as Open Asset Import Library is a library to load various 3d file formats into a shared, in-memory format. It supports more than __40 file formats__ for import and a growing selection of file formats for export. -And we also have an IRC-channel at freenode: #assetimporterlib . You can easily join us via: [KiwiIRC/freenote](https://kiwiirc.com/client/irc.freenode.net), choose your nickname and type -> /join #assetimporterlib +And we also have a Gitter-channel:Gitter [![Join the chat at https://gitter.im/assimp/assimp](https://badges.gitter.im/assimp/assimp.svg)](https://gitter.im/assimp/assimp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
### Contributing ### Contributions to assimp are highly appreciated. The easiest way to get involved is to submit diff --git a/code/ASEParser.cpp b/code/ASEParser.cpp index 01c58d259..d34da2578 100644 --- a/code/ASEParser.cpp +++ b/code/ASEParser.cpp @@ -25,8 +25,8 @@ conditions are met: derived from this software without specific prior written permission of the assimp team. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, @@ -1463,30 +1463,29 @@ void Parser::ParseLV2MeshBlock(ASE::Mesh& mesh) continue; } // another mesh UV channel ... - if (TokenMatch(filePtr,"MESH_MAPPINGCHANNEL" ,19)) - { - - unsigned int iIndex = 0; + if (TokenMatch(filePtr,"MESH_MAPPINGCHANNEL" ,19)) { + unsigned int iIndex( 0 ); ParseLV4MeshLong(iIndex); - - if (iIndex < 2) - { - LogWarning("Mapping channel has an invalid index. Skipping UV channel"); + if ( 0 == iIndex ) { + LogWarning( "Mapping channel has an invalid index. Skipping UV channel" ); // skip it ... SkipSection(); + } else { + if ( iIndex < 2 ) { + LogWarning( "Mapping channel has an invalid index. Skipping UV channel" ); + // skip it ... + SkipSection(); + } + if ( iIndex > AI_MAX_NUMBER_OF_TEXTURECOORDS ) { + LogWarning( "Too many UV channels specified. Skipping channel .." ); + // skip it ... + SkipSection(); + } else { + // parse the mapping channel + ParseLV3MappingChannel( iIndex - 1, mesh ); + } + continue; } - if (iIndex > AI_MAX_NUMBER_OF_TEXTURECOORDS) - { - LogWarning("Too many UV channels specified. Skipping channel .."); - // skip it ... - SkipSection(); - } - else - { - // parse the mapping channel - ParseLV3MappingChannel(iIndex-1,mesh); - } - continue; } // mesh animation keyframe. Not supported if (TokenMatch(filePtr,"MESH_ANIMATION" ,14)) diff --git a/code/BlenderDNA.h b/code/BlenderDNA.h index 801d68fce..135e38d60 100644 --- a/code/BlenderDNA.h +++ b/code/BlenderDNA.h @@ -61,15 +61,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // #define ASSIMP_BUILD_BLENDER_NO_STATS namespace Assimp { - template class StreamReader; - typedef StreamReader StreamReaderAny; - namespace Blender { - class FileDatabase; - struct FileBlockHead; +template class StreamReader; +typedef StreamReader StreamReaderAny; - template