Merge branch 'master' into master
commit
100a7a7c11
|
@ -71,7 +71,7 @@ IncludeCategories:
|
|||
Priority: 3
|
||||
# IncludeIsMainRegex: '(Test)?$'
|
||||
IndentCaseLabels: true
|
||||
# IndentPPDirectives: None
|
||||
IndentPPDirectives: AfterHash
|
||||
IndentWidth: 4
|
||||
# IndentWrappedFunctionNames: false
|
||||
# JavaScriptQuotes: Leave
|
||||
|
|
|
@ -49,7 +49,7 @@ IF(HUNTER_ENABLED)
|
|||
)
|
||||
|
||||
add_definitions(-DASSIMP_USE_HUNTER)
|
||||
ENDIF(HUNTER_ENABLED)
|
||||
ENDIF()
|
||||
|
||||
PROJECT( Assimp VERSION 5.0.1 )
|
||||
|
||||
|
@ -141,9 +141,9 @@ OPTION ( IGNORE_GIT_HASH
|
|||
IF (IOS AND NOT HUNTER_ENABLED)
|
||||
IF (NOT CMAKE_BUILD_TYPE)
|
||||
SET(CMAKE_BUILD_TYPE "Release")
|
||||
ENDIF (NOT CMAKE_BUILD_TYPE)
|
||||
ENDIF ()
|
||||
ADD_DEFINITIONS(-DENABLE_BITCODE)
|
||||
ENDIF (IOS AND NOT HUNTER_ENABLED)
|
||||
ENDIF ()
|
||||
|
||||
# Use subset of Windows.h
|
||||
if (WIN32)
|
||||
|
@ -159,19 +159,19 @@ IF(MSVC)
|
|||
# Multibyte character set is deprecated since at least MSVC2015 (possibly earlier)
|
||||
ADD_DEFINITIONS( -DUNICODE -D_UNICODE )
|
||||
ENDIF()
|
||||
ENDIF(MSVC)
|
||||
ENDIF()
|
||||
|
||||
IF (BUILD_FRAMEWORK)
|
||||
SET (BUILD_SHARED_LIBS ON)
|
||||
MESSAGE(STATUS "Framework bundle building enabled")
|
||||
ENDIF(BUILD_FRAMEWORK)
|
||||
ENDIF()
|
||||
|
||||
IF(NOT BUILD_SHARED_LIBS)
|
||||
MESSAGE(STATUS "Shared libraries disabled")
|
||||
SET(LINK_SEARCH_START_STATIC TRUE)
|
||||
ELSE()
|
||||
MESSAGE(STATUS "Shared libraries enabled")
|
||||
ENDIF(NOT BUILD_SHARED_LIBS)
|
||||
ENDIF()
|
||||
|
||||
# Define here the needed parameters
|
||||
SET (ASSIMP_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
|
||||
|
@ -208,11 +208,11 @@ ENDIF()
|
|||
|
||||
IF(NOT GIT_COMMIT_HASH)
|
||||
SET(GIT_COMMIT_HASH 0)
|
||||
ENDIF(NOT GIT_COMMIT_HASH)
|
||||
ENDIF()
|
||||
|
||||
IF(ASSIMP_DOUBLE_PRECISION)
|
||||
ADD_DEFINITIONS(-DASSIMP_DOUBLE_PRECISION)
|
||||
ENDIF(ASSIMP_DOUBLE_PRECISION)
|
||||
ENDIF()
|
||||
|
||||
CONFIGURE_FILE(
|
||||
${CMAKE_CURRENT_LIST_DIR}/revision.h.in
|
||||
|
@ -241,7 +241,7 @@ SET(ASSIMP_LIBRARY_SUFFIX "" CACHE STRING "Suffix to append to library names")
|
|||
IF( UNIX )
|
||||
# Use GNUInstallDirs for Unix predefined directories
|
||||
INCLUDE(GNUInstallDirs)
|
||||
ENDIF( UNIX )
|
||||
ENDIF()
|
||||
|
||||
# Grouped compiler settings
|
||||
IF ((CMAKE_C_COMPILER_ID MATCHES "GNU") AND NOT CMAKE_COMPILER_IS_MINGW)
|
||||
|
@ -293,7 +293,7 @@ IF ( IOS AND NOT HUNTER_ENABLED)
|
|||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fembed-bitcode -O3")
|
||||
# Experimental for pdb generation
|
||||
ENDIF()
|
||||
ENDIF( IOS AND NOT HUNTER_ENABLED)
|
||||
ENDIF()
|
||||
|
||||
IF (ASSIMP_COVERALLS)
|
||||
MESSAGE(STATUS "Coveralls enabled")
|
||||
|
@ -342,10 +342,14 @@ INCLUDE (PrecompiledHeader)
|
|||
# source tree. During an out-of-source build, however, do not litter this
|
||||
# directory, since that is probably what the user wanted to avoid.
|
||||
IF ( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR )
|
||||
SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_HOME_DIRECTORY}/lib" )
|
||||
SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_HOME_DIRECTORY}/bin" )
|
||||
SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_HOME_DIRECTORY}/lib" )
|
||||
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_HOME_DIRECTORY}/bin" )
|
||||
ENDIF ( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR )
|
||||
ELSE()
|
||||
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib")
|
||||
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
|
||||
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
|
||||
ENDIF ()
|
||||
|
||||
# Cache these to allow the user to override them manually.
|
||||
SET( ASSIMP_LIB_INSTALL_DIR "lib" CACHE STRING
|
||||
|
@ -407,7 +411,7 @@ IF(HUNTER_ENABLED)
|
|||
NAMESPACE "${NAMESPACE}"
|
||||
DESTINATION "${CONFIG_INSTALL_DIR}"
|
||||
)
|
||||
ELSE(HUNTER_ENABLED)
|
||||
ELSE()
|
||||
# cmake configuration files
|
||||
if(${BUILD_SHARED_LIBS})
|
||||
set(BUILD_LIB_TYPE SHARED)
|
||||
|
@ -435,20 +439,16 @@ ELSE(HUNTER_ENABLED)
|
|||
"${CMAKE_CURRENT_BINARY_DIR}/assimpTargets.cmake"
|
||||
${PACKAGE_TARGETS_FILE}
|
||||
DESTINATION "${ASSIMP_LIB_INSTALL_DIR}/cmake/assimp-${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}" COMPONENT ${LIBASSIMP-DEV_COMPONENT})
|
||||
ENDIF(HUNTER_ENABLED)
|
||||
|
||||
if (ASSIMP_BUILD_SAMPLES OR ASSIMP_BUILD_SAMPLES)
|
||||
FIND_PACKAGE(DirectX)
|
||||
endif(ASSIMP_BUILD_SAMPLES OR ASSIMP_BUILD_SAMPLES)
|
||||
ENDIF()
|
||||
|
||||
IF( BUILD_DOCS )
|
||||
ADD_SUBDIRECTORY(doc)
|
||||
ENDIF( BUILD_DOCS )
|
||||
ENDIF()
|
||||
|
||||
# Look for system installed irrXML
|
||||
IF ( SYSTEM_IRRXML )
|
||||
FIND_PACKAGE( IrrXML REQUIRED )
|
||||
ENDIF( SYSTEM_IRRXML )
|
||||
ENDIF()
|
||||
|
||||
# Search for external dependencies, and build them from source if not found
|
||||
# Search for zlib
|
||||
|
@ -460,10 +460,10 @@ IF(HUNTER_ENABLED)
|
|||
set(ZLIB_FOUND TRUE)
|
||||
set(ZLIB_LIBRARIES ZLIB::zlib)
|
||||
set(ASSIMP_BUILD_MINIZIP TRUE)
|
||||
ELSE(HUNTER_ENABLED)
|
||||
ELSE()
|
||||
IF ( NOT ASSIMP_BUILD_ZLIB )
|
||||
FIND_PACKAGE(ZLIB)
|
||||
ENDIF( NOT ASSIMP_BUILD_ZLIB )
|
||||
ENDIF()
|
||||
|
||||
IF( NOT ZLIB_FOUND )
|
||||
MESSAGE(STATUS "compiling zlib from sources")
|
||||
|
@ -486,46 +486,46 @@ ELSE(HUNTER_ENABLED)
|
|||
SET(ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/contrib/zlib ${CMAKE_CURRENT_BINARY_DIR}/contrib/zlib)
|
||||
# need to ensure we don't link with system zlib or minizip as well.
|
||||
SET(ASSIMP_BUILD_MINIZIP 1)
|
||||
ELSE(NOT ZLIB_FOUND)
|
||||
ELSE()
|
||||
ADD_DEFINITIONS(-DASSIMP_BUILD_NO_OWN_ZLIB)
|
||||
SET(ZLIB_LIBRARIES_LINKED -lz)
|
||||
ENDIF(NOT ZLIB_FOUND)
|
||||
ENDIF()
|
||||
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
|
||||
ENDIF(HUNTER_ENABLED)
|
||||
ENDIF()
|
||||
|
||||
IF( NOT IOS )
|
||||
IF( NOT ASSIMP_BUILD_MINIZIP )
|
||||
use_pkgconfig(UNZIP minizip)
|
||||
ENDIF( NOT ASSIMP_BUILD_MINIZIP )
|
||||
ELSE ( NOT IOS )
|
||||
ENDIF()
|
||||
ELSE ()
|
||||
IF( NOT BUILD_SHARED_LIBS )
|
||||
IF( NOT ASSIMP_BUILD_MINIZIP )
|
||||
use_pkgconfig(UNZIP minizip)
|
||||
ENDIF( NOT ASSIMP_BUILD_MINIZIP )
|
||||
ENDIF ( NOT BUILD_SHARED_LIBS )
|
||||
ENDIF ( NOT IOS )
|
||||
ENDIF()
|
||||
ENDIF ()
|
||||
ENDIF ()
|
||||
|
||||
IF ( ASSIMP_NO_EXPORT )
|
||||
ADD_DEFINITIONS( -DASSIMP_BUILD_NO_EXPORT)
|
||||
MESSAGE( STATUS "Build an import-only version of Assimp." )
|
||||
ENDIF( ASSIMP_NO_EXPORT )
|
||||
ENDIF()
|
||||
|
||||
SET ( ASSIMP_BUILD_ARCHITECTURE "" CACHE STRING
|
||||
"describe the current architecture."
|
||||
)
|
||||
IF ( ASSIMP_BUILD_ARCHITECTURE STREQUAL "")
|
||||
ELSE ( ASSIMP_BUILD_ARCHITECTURE STREQUAL "")
|
||||
ELSE ()
|
||||
ADD_DEFINITIONS ( -D'ASSIMP_BUILD_ARCHITECTURE="${ASSIMP_BUILD_ARCHITECTURE}"' )
|
||||
ENDIF ( ASSIMP_BUILD_ARCHITECTURE STREQUAL "")
|
||||
ENDIF ()
|
||||
|
||||
# ${CMAKE_GENERATOR}
|
||||
SET ( ASSIMP_BUILD_COMPILER "" CACHE STRING
|
||||
"describe the current compiler."
|
||||
)
|
||||
IF ( ASSIMP_BUILD_COMPILER STREQUAL "")
|
||||
ELSE ( ASSIMP_BUILD_COMPILER STREQUAL "")
|
||||
ELSE ()
|
||||
ADD_DEFINITIONS ( -D'ASSIMP_BUILD_COMPILER="${ASSIMP_BUILD_COMPILER}"' )
|
||||
ENDIF ( ASSIMP_BUILD_COMPILER STREQUAL "")
|
||||
ENDIF ()
|
||||
|
||||
MARK_AS_ADVANCED ( ASSIMP_BUILD_ARCHITECTURE ASSIMP_BUILD_COMPILER )
|
||||
|
||||
|
@ -571,14 +571,14 @@ IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
|
|||
MESSAGE( FATAL_ERROR
|
||||
"C4D is currently only available on Windows with melange SDK installed in contrib/Melange"
|
||||
)
|
||||
ENDIF ( MSVC )
|
||||
ELSE (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
|
||||
ENDIF ()
|
||||
ELSE ()
|
||||
ADD_DEFINITIONS( -DASSIMP_BUILD_NO_C4D_IMPORTER )
|
||||
ENDIF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
|
||||
ENDIF ()
|
||||
|
||||
IF(NOT HUNTER_ENABLED)
|
||||
ADD_SUBDIRECTORY(contrib)
|
||||
ENDIF(NOT HUNTER_ENABLED)
|
||||
ENDIF()
|
||||
|
||||
ADD_SUBDIRECTORY( code/ )
|
||||
IF ( ASSIMP_BUILD_ASSIMP_TOOLS )
|
||||
|
@ -587,29 +587,29 @@ IF ( ASSIMP_BUILD_ASSIMP_TOOLS )
|
|||
OPTION ( ASSIMP_BUILD_ASSIMP_VIEW "If the Assimp view tool is built. (requires DirectX)" ${DirectX_FOUND} )
|
||||
IF ( ASSIMP_BUILD_ASSIMP_VIEW )
|
||||
ADD_SUBDIRECTORY( tools/assimp_view/ )
|
||||
ENDIF ( ASSIMP_BUILD_ASSIMP_VIEW )
|
||||
ENDIF ( WIN32 AND DirectX_D3DX9_LIBRARY )
|
||||
ENDIF ()
|
||||
ENDIF ()
|
||||
# Te command line tool
|
||||
ADD_SUBDIRECTORY( tools/assimp_cmd/ )
|
||||
ENDIF ( ASSIMP_BUILD_ASSIMP_TOOLS )
|
||||
ENDIF ()
|
||||
|
||||
IF ( ASSIMP_BUILD_SAMPLES)
|
||||
IF ( WIN32 )
|
||||
ADD_SUBDIRECTORY( samples/SimpleTexturedOpenGL/ )
|
||||
ADD_SUBDIRECTORY( samples/SimpleTexturedDirectx11 )
|
||||
ENDIF ( WIN32 )
|
||||
ENDIF ()
|
||||
ADD_SUBDIRECTORY( samples/SimpleOpenGL/ )
|
||||
ENDIF ( ASSIMP_BUILD_SAMPLES )
|
||||
ENDIF ()
|
||||
|
||||
IF ( ASSIMP_BUILD_TESTS )
|
||||
ADD_SUBDIRECTORY( test/ )
|
||||
ENDIF ( ASSIMP_BUILD_TESTS )
|
||||
ENDIF ()
|
||||
|
||||
# Generate a pkg-config .pc for the Assimp library.
|
||||
CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/assimp.pc.in" "${PROJECT_BINARY_DIR}/assimp.pc" @ONLY )
|
||||
IF ( ASSIMP_INSTALL )
|
||||
INSTALL( FILES "${PROJECT_BINARY_DIR}/assimp.pc" DESTINATION ${ASSIMP_LIB_INSTALL_DIR}/pkgconfig/ COMPONENT ${LIBASSIMP-DEV_COMPONENT})
|
||||
ENDIF( ASSIMP_INSTALL )
|
||||
ENDIF()
|
||||
|
||||
IF ( ASSIMP_INSTALL )
|
||||
IF(CMAKE_CPACK_COMMAND AND UNIX AND ASSIMP_OPT_BUILD_PACKAGES)
|
||||
|
@ -680,7 +680,7 @@ if(WIN32)
|
|||
SET(ASSIMP_MSVC_VERSION "vc140")
|
||||
ELSEIF(MSVC15)
|
||||
SET(ASSIMP_MSVC_VERSION "vc141")
|
||||
ENDIF(MSVC12)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(MSVC12 OR MSVC14 OR MSVC15 )
|
||||
|
@ -705,5 +705,5 @@ if(WIN32)
|
|||
ADD_CUSTOM_COMMAND(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/assimp-${ASSIMP_MSVC_VERSION}-mtd.pdb ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.pdb VERBATIM)
|
||||
ADD_CUSTOM_COMMAND(TARGET UpdateAssimpLibsDebugSymbolsAndDLLs COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/code/assimp-${ASSIMP_MSVC_VERSION}-mtd.pdb ${LIB_DIR}assimp-${ASSIMP_MSVC_VERSION}-mtd.pdb VERBATIM)
|
||||
ENDIF()
|
||||
ENDIF(MSVC12 OR MSVC14 OR MSVC15 )
|
||||
ENDIF (WIN32)
|
||||
ENDIF()
|
||||
ENDIF ()
|
||||
|
|
|
@ -49,7 +49,7 @@ SET( HEADER_PATH ../include/assimp )
|
|||
if(NOT ANDROID AND ASSIMP_ANDROID_JNIIOSYSTEM)
|
||||
message(WARNING "Requesting Android JNI I/O-System in non-Android toolchain. Resetting ASSIMP_ANDROID_JNIIOSYSTEM to OFF.")
|
||||
set(ASSIMP_ANDROID_JNIIOSYSTEM OFF)
|
||||
endif(NOT ANDROID AND ASSIMP_ANDROID_JNIIOSYSTEM)
|
||||
endif()
|
||||
|
||||
SET( COMPILER_HEADERS
|
||||
${HEADER_PATH}/Compiler/pushpack1.h
|
||||
|
@ -148,7 +148,7 @@ SET( Core_SRCS
|
|||
|
||||
IF(MSVC)
|
||||
list(APPEND Core_SRCS "res/assimp.rc")
|
||||
ENDIF(MSVC)
|
||||
ENDIF()
|
||||
|
||||
SET( Logging_SRCS
|
||||
${HEADER_PATH}/DefaultLogger.hpp
|
||||
|
@ -222,7 +222,7 @@ IF ( ASSIMP_BUILD_NONFREE_C4D_IMPORTER )
|
|||
C4D/C4DImporter.h
|
||||
)
|
||||
SOURCE_GROUP( C4D FILES ${C4D_SRCS})
|
||||
ENDIF ( ASSIMP_BUILD_NONFREE_C4D_IMPORTER )
|
||||
ENDIF ()
|
||||
|
||||
# if this variable is set to TRUE, the user can manually disable importers by setting
|
||||
# ASSIMP_BUILD_XXX_IMPORTER to FALSE for each importer
|
||||
|
@ -599,7 +599,7 @@ if (ASSIMP_BUILD_IFC_IMPORTER)
|
|||
elseif(CMAKE_COMPILER_IS_MINGW)
|
||||
set_source_files_properties(Importer/IFC/IFCReaderGen1_2x3.cpp Importer/IFC/IFCReaderGen2_2x3.cpp PROPERTIES COMPILE_FLAGS "-O2 -Wa,-mbig-obj")
|
||||
endif()
|
||||
endif (ASSIMP_BUILD_IFC_IMPORTER)
|
||||
endif ()
|
||||
|
||||
ADD_ASSIMP_IMPORTER( XGL
|
||||
XGL/XGLLoader.cpp
|
||||
|
@ -897,35 +897,35 @@ SOURCE_GROUP( Extra FILES ${Extra_SRCS})
|
|||
IF(HUNTER_ENABLED)
|
||||
hunter_add_package(irrXML)
|
||||
find_package(irrXML CONFIG REQUIRED)
|
||||
ELSE(HUNTER_ENABLED)
|
||||
ELSE()
|
||||
# irrXML already included in contrib directory by parent CMakeLists.txt.
|
||||
ENDIF(HUNTER_ENABLED)
|
||||
ENDIF()
|
||||
|
||||
# utf8
|
||||
IF(HUNTER_ENABLED)
|
||||
hunter_add_package(utf8)
|
||||
find_package(utf8 CONFIG REQUIRED)
|
||||
ELSE(HUNTER_ENABLED)
|
||||
ELSE()
|
||||
# utf8 is header-only, so Assimp doesn't need to do anything.
|
||||
ENDIF(HUNTER_ENABLED)
|
||||
ENDIF()
|
||||
|
||||
# polyclipping
|
||||
IF(HUNTER_ENABLED)
|
||||
hunter_add_package(polyclipping)
|
||||
find_package(polyclipping CONFIG REQUIRED)
|
||||
ELSE(HUNTER_ENABLED)
|
||||
ELSE()
|
||||
SET( Clipper_SRCS
|
||||
../contrib/clipper/clipper.hpp
|
||||
../contrib/clipper/clipper.cpp
|
||||
)
|
||||
SOURCE_GROUP( Contrib\\Clipper FILES ${Clipper_SRCS})
|
||||
ENDIF(HUNTER_ENABLED)
|
||||
ENDIF()
|
||||
|
||||
# poly2tri
|
||||
IF(HUNTER_ENABLED)
|
||||
hunter_add_package(poly2tri)
|
||||
find_package(poly2tri CONFIG REQUIRED)
|
||||
ELSE(HUNTER_ENABLED)
|
||||
ELSE()
|
||||
SET( Poly2Tri_SRCS
|
||||
../contrib/poly2tri/poly2tri/common/shapes.cc
|
||||
../contrib/poly2tri/poly2tri/common/shapes.h
|
||||
|
@ -940,13 +940,13 @@ ELSE(HUNTER_ENABLED)
|
|||
../contrib/poly2tri/poly2tri/sweep/sweep_context.h
|
||||
)
|
||||
SOURCE_GROUP( Contrib\\Poly2Tri FILES ${Poly2Tri_SRCS})
|
||||
ENDIF(HUNTER_ENABLED)
|
||||
ENDIF()
|
||||
|
||||
# minizip/unzip
|
||||
IF(HUNTER_ENABLED)
|
||||
hunter_add_package(minizip)
|
||||
find_package(minizip CONFIG REQUIRED)
|
||||
ELSE(HUNTER_ENABLED)
|
||||
ELSE()
|
||||
SET( unzip_SRCS
|
||||
../contrib/unzip/crypt.h
|
||||
../contrib/unzip/ioapi.c
|
||||
|
@ -955,13 +955,13 @@ ELSE(HUNTER_ENABLED)
|
|||
../contrib/unzip/unzip.h
|
||||
)
|
||||
SOURCE_GROUP(Contrib\\unzip FILES ${unzip_SRCS})
|
||||
ENDIF(HUNTER_ENABLED)
|
||||
ENDIF()
|
||||
|
||||
# zip (https://github.com/kuba--/zip)
|
||||
IF(HUNTER_ENABLED)
|
||||
hunter_add_package(zip)
|
||||
find_package(zip CONFIG REQUIRED)
|
||||
ELSE(HUNTER_ENABLED)
|
||||
ELSE()
|
||||
SET( ziplib_SRCS
|
||||
../contrib/zip/src/miniz.h
|
||||
../contrib/zip/src/zip.c
|
||||
|
@ -976,13 +976,13 @@ ELSE(HUNTER_ENABLED)
|
|||
endif()
|
||||
|
||||
SOURCE_GROUP( ziplib FILES ${ziplib_SRCS} )
|
||||
ENDIF(HUNTER_ENABLED)
|
||||
ENDIF()
|
||||
|
||||
# openddlparser
|
||||
IF(HUNTER_ENABLED)
|
||||
hunter_add_package(openddlparser)
|
||||
find_package(openddlparser CONFIG REQUIRED)
|
||||
ELSE(HUNTER_ENABLED)
|
||||
ELSE()
|
||||
SET ( openddl_parser_SRCS
|
||||
../contrib/openddlparser/code/OpenDDLParser.cpp
|
||||
../contrib/openddlparser/code/DDLNode.cpp
|
||||
|
@ -999,12 +999,12 @@ ELSE(HUNTER_ENABLED)
|
|||
../contrib/openddlparser/include/openddlparser/Value.h
|
||||
)
|
||||
SOURCE_GROUP( Contrib\\openddl_parser FILES ${openddl_parser_SRCS})
|
||||
ENDIF(HUNTER_ENABLED)
|
||||
ENDIF()
|
||||
|
||||
# Open3DGC
|
||||
IF(HUNTER_ENABLED)
|
||||
# Nothing to do, not available in Hunter yet.
|
||||
ELSE(HUNTER_ENABLED)
|
||||
ELSE()
|
||||
SET ( open3dgc_SRCS
|
||||
../contrib/Open3DGC/o3dgcAdjacencyInfo.h
|
||||
../contrib/Open3DGC/o3dgcArithmeticCodec.cpp
|
||||
|
@ -1037,7 +1037,7 @@ ELSE(HUNTER_ENABLED)
|
|||
../contrib/Open3DGC/o3dgcVector.inl
|
||||
)
|
||||
SOURCE_GROUP( Contrib\\open3dgc FILES ${open3dgc_SRCS})
|
||||
ENDIF(HUNTER_ENABLED)
|
||||
ENDIF()
|
||||
|
||||
# Check dependencies for glTF importer with Open3DGC-compression.
|
||||
# RT-extensions is used in "contrib/Open3DGC/o3dgcTimer.h" for collecting statistics. Pointed file
|
||||
|
@ -1056,34 +1056,34 @@ ENDIF ()
|
|||
IF(HUNTER_ENABLED)
|
||||
hunter_add_package(RapidJSON)
|
||||
find_package(RapidJSON CONFIG REQUIRED)
|
||||
ELSE(HUNTER_ENABLED)
|
||||
ELSE()
|
||||
INCLUDE_DIRECTORIES( "../contrib/rapidjson/include" )
|
||||
INCLUDE_DIRECTORIES( "../contrib" )
|
||||
ENDIF(HUNTER_ENABLED)
|
||||
ENDIF()
|
||||
|
||||
# VC2010 fixes
|
||||
if(MSVC10)
|
||||
option( VC10_STDINT_FIX "Fix for VC10 Compiler regarding pstdint.h redefinition errors" OFF )
|
||||
if( VC10_STDINT_FIX )
|
||||
ADD_DEFINITIONS( -D_STDINT )
|
||||
endif( VC10_STDINT_FIX )
|
||||
endif(MSVC10)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
ADD_DEFINITIONS( -DASSIMP_BUILD_DLL_EXPORT )
|
||||
|
||||
if ( MSVC )
|
||||
ADD_DEFINITIONS( -D_SCL_SECURE_NO_WARNINGS )
|
||||
ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS )
|
||||
endif ( MSVC )
|
||||
endif ()
|
||||
|
||||
IF(NOT HUNTER_ENABLED)
|
||||
if (UNZIP_FOUND)
|
||||
SET (unzip_compile_SRCS "")
|
||||
else (UNZIP_FOUND)
|
||||
else ()
|
||||
SET (unzip_compile_SRCS ${unzip_SRCS})
|
||||
INCLUDE_DIRECTORIES( "../contrib/unzip/" )
|
||||
endif (UNZIP_FOUND)
|
||||
ENDIF(NOT HUNTER_ENABLED)
|
||||
endif ()
|
||||
ENDIF()
|
||||
|
||||
MESSAGE(STATUS "Enabled importer formats:${ASSIMP_IMPORTERS_ENABLED}")
|
||||
MESSAGE(STATUS "Disabled importer formats:${ASSIMP_IMPORTERS_DISABLED}")
|
||||
|
@ -1129,12 +1129,12 @@ IF(NOT HUNTER_ENABLED)
|
|||
${IRRXML_INCLUDE_DIR}
|
||||
../contrib/openddlparser/include
|
||||
)
|
||||
ENDIF(NOT HUNTER_ENABLED)
|
||||
ENDIF()
|
||||
|
||||
IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
|
||||
SET( assimp_src ${assimp_src} ${C4D_SRCS})
|
||||
INCLUDE_DIRECTORIES(${C4D_INCLUDES})
|
||||
ENDIF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
|
||||
ENDIF ()
|
||||
|
||||
ADD_LIBRARY( assimp ${assimp_src} )
|
||||
ADD_LIBRARY(assimp::assimp ALIAS assimp)
|
||||
|
@ -1158,21 +1158,21 @@ IF(HUNTER_ENABLED)
|
|||
utf8::utf8
|
||||
zip::zip
|
||||
)
|
||||
ELSE(HUNTER_ENABLED)
|
||||
ELSE()
|
||||
TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES} ${IRRXML_LIBRARY} )
|
||||
ENDIF(HUNTER_ENABLED)
|
||||
ENDIF()
|
||||
|
||||
if(ASSIMP_ANDROID_JNIIOSYSTEM)
|
||||
set(ASSIMP_ANDROID_JNIIOSYSTEM_PATH port/AndroidJNI)
|
||||
add_subdirectory(../${ASSIMP_ANDROID_JNIIOSYSTEM_PATH}/ ../${ASSIMP_ANDROID_JNIIOSYSTEM_PATH}/)
|
||||
target_link_libraries(assimp android_jniiosystem)
|
||||
endif(ASSIMP_ANDROID_JNIIOSYSTEM)
|
||||
endif()
|
||||
|
||||
IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
|
||||
TARGET_LINK_LIBRARIES(assimp optimized ${C4D_RELEASE_LIBRARIES})
|
||||
TARGET_LINK_LIBRARIES(assimp debug ${C4D_DEBUG_LIBRARIES})
|
||||
TARGET_LINK_LIBRARIES(assimp ${C4D_EXTRA_LIBRARIES})
|
||||
ENDIF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
|
||||
ENDIF ()
|
||||
|
||||
if( MSVC )
|
||||
# in order to prevent DLL hell, each of the DLLs have to be suffixed with the major version and msvc prefix
|
||||
|
@ -1233,8 +1233,8 @@ if (APPLE)
|
|||
"../${HEADER_PATH}/Compiler"
|
||||
assimp.framework/Headers/Compiler
|
||||
COMMENT "Copying public ./Compiler/ header files to framework bundle's Headers/Compiler/")
|
||||
ENDIF(BUILD_FRAMEWORK)
|
||||
ENDIF(APPLE)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# Build against external unzip, or add ../contrib/unzip so
|
||||
# assimp can #include "unzip.h"
|
||||
|
@ -1242,15 +1242,15 @@ IF(NOT HUNTER_ENABLED)
|
|||
if (UNZIP_FOUND)
|
||||
INCLUDE_DIRECTORIES(${UNZIP_INCLUDE_DIRS})
|
||||
TARGET_LINK_LIBRARIES(assimp ${UNZIP_LIBRARIES})
|
||||
else (UNZIP_FOUND)
|
||||
else ()
|
||||
INCLUDE_DIRECTORIES("../")
|
||||
endif (UNZIP_FOUND)
|
||||
ENDIF(NOT HUNTER_ENABLED)
|
||||
endif ()
|
||||
ENDIF()
|
||||
|
||||
# Add RT-extension library for glTF importer with Open3DGC-compression.
|
||||
IF (RT_FOUND AND ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC)
|
||||
TARGET_LINK_LIBRARIES(assimp ${RT_LIBRARY})
|
||||
ENDIF (RT_FOUND AND ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC)
|
||||
ENDIF ()
|
||||
|
||||
IF(HUNTER_ENABLED)
|
||||
INSTALL( TARGETS assimp
|
||||
|
@ -1261,14 +1261,14 @@ IF(HUNTER_ENABLED)
|
|||
FRAMEWORK DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
|
||||
COMPONENT ${LIBASSIMP_COMPONENT}
|
||||
INCLUDES DESTINATION "include")
|
||||
ELSE(HUNTER_ENABLED)
|
||||
ELSE()
|
||||
INSTALL( TARGETS assimp
|
||||
LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
|
||||
ARCHIVE DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
|
||||
RUNTIME DESTINATION ${ASSIMP_BIN_INSTALL_DIR}
|
||||
FRAMEWORK DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
|
||||
COMPONENT ${LIBASSIMP_COMPONENT})
|
||||
ENDIF(HUNTER_ENABLED)
|
||||
ENDIF()
|
||||
INSTALL( FILES ${PUBLIC_HEADERS} DESTINATION ${ASSIMP_INCLUDE_INSTALL_DIR}/assimp COMPONENT assimp-dev)
|
||||
INSTALL( FILES ${COMPILER_HEADERS} DESTINATION ${ASSIMP_INCLUDE_INSTALL_DIR}/assimp/Compiler COMPONENT assimp-dev)
|
||||
|
||||
|
@ -1276,7 +1276,7 @@ if (ASSIMP_ANDROID_JNIIOSYSTEM)
|
|||
INSTALL(FILES ${HEADER_PATH}/${ASSIMP_ANDROID_JNIIOSYSTEM_PATH}/AndroidJNIIOSystem.h
|
||||
DESTINATION ${ASSIMP_INCLUDE_INSTALL_DIR}
|
||||
COMPONENT assimp-dev)
|
||||
ENDIF(ASSIMP_ANDROID_JNIIOSYSTEM)
|
||||
ENDIF()
|
||||
|
||||
if(MSVC AND ASSIMP_INSTALL_PDB)
|
||||
# When only the static library is built, these properties must
|
||||
|
|
|
@ -191,7 +191,7 @@ void BaseImporter::GetExtensionList(std::set<std::string>& extensions) {
|
|||
}
|
||||
|
||||
std::unique_ptr<IOStream> pStream (pIOHandler->Open(pFile));
|
||||
if (pStream.get() ) {
|
||||
if (pStream) {
|
||||
// read 200 characters from the file
|
||||
std::unique_ptr<char[]> _buffer (new char[searchBytes+1 /* for the '\0' */]);
|
||||
char *buffer( _buffer.get() );
|
||||
|
@ -283,7 +283,6 @@ std::string BaseImporter::GetExtension( const std::string& file ) {
|
|||
return "";
|
||||
}
|
||||
|
||||
|
||||
// thanks to Andy Maloney for the hint
|
||||
std::string ret = file.substr( pos + 1 );
|
||||
std::transform( ret.begin(), ret.end(), ret.begin(), ToLower<char>);
|
||||
|
@ -309,7 +308,7 @@ std::string BaseImporter::GetExtension( const std::string& file ) {
|
|||
};
|
||||
magic = reinterpret_cast<const char*>(_magic);
|
||||
std::unique_ptr<IOStream> pStream (pIOHandler->Open(pFile));
|
||||
if (pStream.get() ) {
|
||||
if (pStream) {
|
||||
|
||||
// skip to offset
|
||||
pStream->Seek(offset,aiOrigin_SET);
|
||||
|
@ -603,7 +602,7 @@ unsigned int BatchLoader::AddLoadRequest(const std::string& file,
|
|||
}
|
||||
|
||||
// no, we don't have it. So add it to the queue ...
|
||||
m_data->requests.push_back(LoadRequest(file,steps,map, m_data->next_id));
|
||||
m_data->requests.emplace_back(file, steps, map, m_data->next_id);
|
||||
return m_data->next_id++;
|
||||
}
|
||||
|
||||
|
|
|
@ -1071,7 +1071,7 @@ ai_real Importer::GetPropertyFloat(const char* szName, ai_real iErrorReturn /*=
|
|||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Get a configuration property
|
||||
const std::string Importer::GetPropertyString(const char* szName, const std::string& iErrorReturn /*= ""*/) const {
|
||||
std::string Importer::GetPropertyString(const char* szName, const std::string& iErrorReturn /*= ""*/) const {
|
||||
ai_assert(nullptr != pimpl);
|
||||
|
||||
return GetGenericProperty<std::string>(pimpl->mStringProperties,szName,iErrorReturn);
|
||||
|
@ -1079,7 +1079,7 @@ const std::string Importer::GetPropertyString(const char* szName, const std::str
|
|||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Get a configuration property
|
||||
const aiMatrix4x4 Importer::GetPropertyMatrix(const char* szName, const aiMatrix4x4& iErrorReturn /*= aiMatrix4x4()*/) const {
|
||||
aiMatrix4x4 Importer::GetPropertyMatrix(const char* szName, const aiMatrix4x4& iErrorReturn /*= aiMatrix4x4()*/) const {
|
||||
ai_assert(nullptr != pimpl);
|
||||
|
||||
return GetGenericProperty<aiMatrix4x4>(pimpl->mMatrixProperties,szName,iErrorReturn);
|
||||
|
@ -1110,10 +1110,9 @@ void Importer::GetMemoryRequirements(aiMemoryInfo& in) const {
|
|||
aiScene* mScene = pimpl->mScene;
|
||||
|
||||
// return if we have no scene loaded
|
||||
if (!pimpl->mScene)
|
||||
if (!mScene)
|
||||
return;
|
||||
|
||||
|
||||
in.total = sizeof(aiScene);
|
||||
|
||||
// add all meshes
|
||||
|
@ -1202,5 +1201,6 @@ void Importer::GetMemoryRequirements(aiMemoryInfo& in) const {
|
|||
in.materials += pc->mProperties[a]->mDataLength;
|
||||
}
|
||||
}
|
||||
|
||||
in.total += in.materials;
|
||||
}
|
||||
|
|
|
@ -343,8 +343,6 @@ namespace Assimp {
|
|||
}
|
||||
|
||||
ZipArchiveIOSystem::Implement::~Implement() {
|
||||
m_ArchiveMap.clear();
|
||||
|
||||
if (m_ZipFileHandle != nullptr) {
|
||||
unzClose(m_ZipFileHandle);
|
||||
m_ZipFileHandle = nullptr;
|
||||
|
|
|
@ -110,10 +110,7 @@ struct Object {
|
|||
std::vector<unsigned int> m_Meshes;
|
||||
|
||||
//! \brief Default constructor
|
||||
Object()
|
||||
: m_strObjName("") {
|
||||
// empty
|
||||
}
|
||||
Object() = default;
|
||||
|
||||
//! \brief Destructor
|
||||
~Object() {
|
||||
|
@ -191,16 +188,12 @@ struct Material {
|
|||
, illumination_model (1)
|
||||
, ior ( ai_real( 1.0 ) )
|
||||
, transparent( ai_real( 1.0), ai_real (1.0), ai_real(1.0)) {
|
||||
// empty
|
||||
for (size_t i = 0; i < TextureTypeCount; ++i) {
|
||||
clamp[ i ] = false;
|
||||
}
|
||||
|
||||
std::fill_n(clamp, static_cast<unsigned int>(TextureTypeCount), false);
|
||||
}
|
||||
|
||||
// Destructor
|
||||
~Material() {
|
||||
// empty
|
||||
}
|
||||
~Material() = default;
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -53,6 +53,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#include <assimp/material.h>
|
||||
#include <assimp/Importer.hpp>
|
||||
#include <cstdlib>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
namespace Assimp {
|
||||
|
||||
|
@ -71,16 +73,16 @@ ObjFileParser::ObjFileParser()
|
|||
|
||||
ObjFileParser::ObjFileParser( IOStreamBuffer<char> &streamBuffer, const std::string &modelName,
|
||||
IOSystem *io, ProgressHandler* progress,
|
||||
const std::string &originalObjFileName) :
|
||||
std::string originalObjFileName) :
|
||||
m_DataIt(),
|
||||
m_DataItEnd(),
|
||||
m_pModel(nullptr),
|
||||
m_uiLine(0),
|
||||
m_pIO( io ),
|
||||
m_pIO(io),
|
||||
m_progress(progress),
|
||||
m_originalObjFileName(originalObjFileName)
|
||||
m_originalObjFileName(std::move(originalObjFileName))
|
||||
{
|
||||
std::fill_n(m_buffer,Buffersize,0);
|
||||
std::fill_n(m_buffer, Buffersize,0);
|
||||
|
||||
// Create the model instance to store all the data
|
||||
m_pModel.reset(new ObjFile::Model());
|
||||
|
@ -96,7 +98,8 @@ ObjFileParser::ObjFileParser( IOStreamBuffer<char> &streamBuffer, const std::str
|
|||
parseFile( streamBuffer );
|
||||
}
|
||||
|
||||
ObjFileParser::~ObjFileParser() {
|
||||
ObjFileParser::~ObjFileParser()
|
||||
{
|
||||
}
|
||||
|
||||
void ObjFileParser::setBuffer( std::vector<char> &buffer ) {
|
||||
|
@ -128,7 +131,7 @@ void ObjFileParser::parseFile( IOStreamBuffer<char> &streamBuffer ) {
|
|||
processed = static_cast<unsigned int>(filePos);
|
||||
lastFilePos = filePos;
|
||||
progressCounter++;
|
||||
m_progress->UpdateFileRead( processed, progressTotal );
|
||||
m_progress->UpdateFileRead(processed, progressTotal);
|
||||
}
|
||||
|
||||
// parse line
|
||||
|
|
|
@ -78,7 +78,7 @@ public:
|
|||
/// @brief The default constructor.
|
||||
ObjFileParser();
|
||||
/// @brief Constructor with data array.
|
||||
ObjFileParser( IOStreamBuffer<char> &streamBuffer, const std::string &modelName, IOSystem* io, ProgressHandler* progress, const std::string &originalObjFileName);
|
||||
ObjFileParser(IOStreamBuffer<char> &streamBuffer, const std::string &modelName, IOSystem* io, ProgressHandler* progress, std::string originalObjFileName);
|
||||
/// @brief Destructor
|
||||
~ObjFileParser();
|
||||
/// @brief If you want to load in-core data.
|
||||
|
|
|
@ -92,9 +92,8 @@ void TextureTransformStep::PreProcessUVTransform(STransformVecInfo& info)
|
|||
* are applied is - as always - scaling, rotation, translation.
|
||||
*/
|
||||
|
||||
int rounded;
|
||||
char szTemp[512];
|
||||
int rounded = 0;
|
||||
|
||||
|
||||
/* Optimize the rotation angle. That's slightly difficult as
|
||||
* we have an inprecise floating-point number (when comparing
|
||||
|
@ -185,7 +184,6 @@ void TextureTransformStep::PreProcessUVTransform(STransformVecInfo& info)
|
|||
info.mTranslation.y = out;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
@ -428,7 +426,7 @@ void TextureTransformStep::Execute( aiScene* pScene)
|
|||
// at the end of the list
|
||||
bool ref[AI_MAX_NUMBER_OF_TEXTURECOORDS];
|
||||
for (unsigned int n = 0; n < AI_MAX_NUMBER_OF_TEXTURECOORDS;++n)
|
||||
ref[n] = (!mesh->mTextureCoords[n] ? true : false);
|
||||
ref[n] = !mesh->mTextureCoords[n];
|
||||
|
||||
for (it = trafo.begin();it != trafo.end(); ++it)
|
||||
ref[(*it).uvIndex] = true;
|
||||
|
|
|
@ -222,6 +222,7 @@ void glTFImporter::ImportMeshes(glTF::Asset& r)
|
|||
std::vector<aiMesh*> meshes;
|
||||
|
||||
unsigned int k = 0;
|
||||
meshOffsets.clear();
|
||||
|
||||
for (unsigned int m = 0; m < r.meshes.Size(); ++m) {
|
||||
Mesh& mesh = r.meshes[m];
|
||||
|
|
|
@ -335,6 +335,7 @@ void glTF2Importer::ImportMeshes(glTF2::Asset &r) {
|
|||
std::vector<aiMesh *> meshes;
|
||||
|
||||
unsigned int k = 0;
|
||||
meshOffsets.clear();
|
||||
|
||||
for (unsigned int m = 0; m < r.meshes.Size(); ++m) {
|
||||
Mesh &mesh = r.meshes[m];
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Compile internal irrXML only if system is not requested
|
||||
if( NOT SYSTEM_IRRXML )
|
||||
add_subdirectory(irrXML)
|
||||
endif( NOT SYSTEM_IRRXML )
|
||||
endif()
|
||||
|
|
|
@ -6,7 +6,7 @@ set( HTML_OUTPUT "AssimpDoc_Html" CACHE STRING "Output directory for generated H
|
|||
set( MICROSOFT_HELP_WORKSHOP "NO")
|
||||
if( MSVC )
|
||||
set( MICROSOFT_HELP_WORKSHOP "YES" )
|
||||
endif( MSVC )
|
||||
endif()
|
||||
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
|
||||
|
@ -38,5 +38,5 @@ if( DEFINED CMAKE_INSTALL_DOCDIR )
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/AssimpDoc_Html/dragonsplash.png
|
||||
DESTINATION ${CMAKE_INSTALL_DOCDIR}/${HTML_OUTPUT}
|
||||
)
|
||||
endif( DEFINED CMAKE_INSTALL_DOCDIR )
|
||||
endif()
|
||||
|
||||
|
|
|
@ -285,7 +285,7 @@ public:
|
|||
* The return value remains valid until the property is modified.
|
||||
* @see GetPropertyInteger()
|
||||
*/
|
||||
const std::string GetPropertyString(const char* szName,
|
||||
std::string GetPropertyString(const char* szName,
|
||||
const std::string& sErrorReturn = "") const;
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
@ -294,7 +294,7 @@ public:
|
|||
* The return value remains valid until the property is modified.
|
||||
* @see GetPropertyInteger()
|
||||
*/
|
||||
const aiMatrix4x4 GetPropertyMatrix(const char* szName,
|
||||
aiMatrix4x4 GetPropertyMatrix(const char* szName,
|
||||
const aiMatrix4x4& sErrorReturn = aiMatrix4x4()) const;
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
|
|
@ -2,24 +2,24 @@ FIND_PACKAGE(OpenGL)
|
|||
FIND_PACKAGE(GLUT)
|
||||
IF ( MSVC )
|
||||
SET(M_LIB)
|
||||
ELSE ( MSVC )
|
||||
ELSE ()
|
||||
find_library(M_LIB m)
|
||||
ENDIF ( MSVC )
|
||||
ENDIF ()
|
||||
|
||||
IF ( NOT GLUT_FOUND )
|
||||
IF ( MSVC )
|
||||
SET ( GLUT_FOUND 1 )
|
||||
SET ( GLUT_INCLUDE_DIR ${Assimp_SOURCE_DIR}/samples/freeglut/ )
|
||||
SET ( GLUT_LIBRARIES ${Assimp_SOURCE_DIR}/samples/freeglut/lib/freeglut.lib )
|
||||
ELSE ( MSVC )
|
||||
ELSE ()
|
||||
MESSAGE( WARNING "Please install glut." )
|
||||
ENDIF ( MSVC )
|
||||
ENDIF ( NOT GLUT_FOUND )
|
||||
ENDIF ()
|
||||
ENDIF ()
|
||||
|
||||
if ( MSVC )
|
||||
ADD_DEFINITIONS( -D_SCL_SECURE_NO_WARNINGS )
|
||||
ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS )
|
||||
endif ( MSVC )
|
||||
endif ()
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
${Assimp_SOURCE_DIR}/include
|
||||
|
|
|
@ -2,13 +2,13 @@ FIND_PACKAGE(DirectX)
|
|||
|
||||
IF ( MSVC )
|
||||
SET(M_LIB)
|
||||
ENDIF ( MSVC )
|
||||
ENDIF ()
|
||||
|
||||
if ( MSVC )
|
||||
ADD_DEFINITIONS( -D_SCL_SECURE_NO_WARNINGS )
|
||||
ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS )
|
||||
REMOVE_DEFINITIONS( -DUNICODE -D_UNICODE )
|
||||
endif ( MSVC )
|
||||
endif ()
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
${Assimp_SOURCE_DIR}/include
|
||||
|
|
|
@ -6,15 +6,15 @@ IF ( NOT GLUT_FOUND )
|
|||
SET ( GLUT_FOUND 1 )
|
||||
SET ( GLUT_INCLUDE_DIR ${Assimp_SOURCE_DIR}/samples/freeglut/ )
|
||||
SET ( GLUT_LIBRARIES ${Assimp_SOURCE_DIR}/samples/freeglut/lib/freeglut.lib )
|
||||
ELSE ( MSVC )
|
||||
ELSE ()
|
||||
MESSAGE( WARNING "Please install glut." )
|
||||
ENDIF ( MSVC )
|
||||
ENDIF ( NOT GLUT_FOUND )
|
||||
ENDIF ()
|
||||
ENDIF ()
|
||||
|
||||
if ( MSVC )
|
||||
ADD_DEFINITIONS( -D_SCL_SECURE_NO_WARNINGS )
|
||||
ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS )
|
||||
endif ( MSVC )
|
||||
endif ()
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
${Assimp_SOURCE_DIR}/include
|
||||
|
|
|
@ -202,8 +202,21 @@ std::string getBasePath(const std::string& path)
|
|||
return (std::string::npos == pos) ? "" : path.substr(0, pos + 1);
|
||||
}
|
||||
|
||||
void freeTextureIds()
|
||||
{
|
||||
textureIdMap.clear(); //no need to delete pointers in it manually here. (Pointers point to textureIds deleted in next step)
|
||||
|
||||
if (textureIds)
|
||||
{
|
||||
delete[] textureIds;
|
||||
textureIds = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
int LoadGLTextures(const aiScene* scene)
|
||||
{
|
||||
freeTextureIds();
|
||||
|
||||
//ILboolean success;
|
||||
|
||||
/* Before calling ilInit() version should be checked. */
|
||||
|
@ -576,20 +589,23 @@ void KillGLWindow() // Properly Kill The Window
|
|||
hRC = NULL;
|
||||
}
|
||||
|
||||
if (hDC && !ReleaseDC(hWnd, hDC)) // Are We able to Release The DC?
|
||||
if (hDC)
|
||||
{
|
||||
if (!ReleaseDC(hWnd, hDC)) // Are We able to Release The DC?
|
||||
MessageBox(NULL, TEXT("Release Device Context Failed."), TEXT("SHUTDOWN ERROR"), MB_OK | MB_ICONINFORMATION);
|
||||
hDC=NULL;
|
||||
hDC = NULL;
|
||||
}
|
||||
|
||||
if (hWnd && !DestroyWindow(hWnd)) // Are We Able To Destroy The Window
|
||||
if (hWnd)
|
||||
{
|
||||
if (!DestroyWindow(hWnd)) // Are We Able To Destroy The Window
|
||||
MessageBox(NULL, TEXT("Could Not Release hWnd."), TEXT("SHUTDOWN ERROR"), MB_OK | MB_ICONINFORMATION);
|
||||
hWnd = NULL;
|
||||
}
|
||||
|
||||
if (!UnregisterClass(TEXT("OpenGL"), hInstance)) // Are We Able To Unregister Class
|
||||
if (hInstance)
|
||||
{
|
||||
if (!UnregisterClass(TEXT("OpenGL"), hInstance)) // Are We Able To Unregister Class
|
||||
MessageBox(NULL, TEXT("Could Not Unregister Class."), TEXT("SHUTDOWN ERROR"), MB_OK | MB_ICONINFORMATION);
|
||||
hInstance = NULL;
|
||||
}
|
||||
|
@ -761,6 +777,16 @@ BOOL CreateGLWindow(const char* title, int width, int height, int bits, bool ful
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
void cleanup()
|
||||
{
|
||||
freeTextureIds();
|
||||
|
||||
destroyAILogger();
|
||||
|
||||
if (hWnd)
|
||||
KillGLWindow();
|
||||
};
|
||||
|
||||
LRESULT CALLBACK WndProc(HWND hWnd, // Handles for this Window
|
||||
UINT uMsg, // Message for this Window
|
||||
WPARAM wParam, // additional message Info
|
||||
|
@ -842,7 +868,11 @@ int WINAPI WinMain( HINSTANCE hInstance, // The instance
|
|||
modelpath = UTFConverter(modelpathW).str();
|
||||
}
|
||||
|
||||
if (!Import3DFromFile(modelpath)) return 0;
|
||||
if (!Import3DFromFile(modelpath))
|
||||
{
|
||||
cleanup();
|
||||
return 0;
|
||||
}
|
||||
|
||||
logInfo("=============== Post Import ====================");
|
||||
|
||||
|
@ -853,6 +883,7 @@ int WINAPI WinMain( HINSTANCE hInstance, // The instance
|
|||
|
||||
if (!CreateGLWindow(windowTitle, 640, 480, 16, fullscreen))
|
||||
{
|
||||
cleanup();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -893,6 +924,7 @@ int WINAPI WinMain( HINSTANCE hInstance, // The instance
|
|||
fullscreen=!fullscreen;
|
||||
if (!CreateGLWindow(windowTitle, 640, 480, 16, fullscreen))
|
||||
{
|
||||
cleanup();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -900,18 +932,6 @@ int WINAPI WinMain( HINSTANCE hInstance, // The instance
|
|||
}
|
||||
|
||||
// *** cleanup ***
|
||||
|
||||
textureIdMap.clear(); //no need to delete pointers in it manually here. (Pointers point to textureIds deleted in next step)
|
||||
|
||||
if (textureIds)
|
||||
{
|
||||
delete[] textureIds;
|
||||
textureIds = NULL;
|
||||
}
|
||||
|
||||
// *** cleanup end ***
|
||||
|
||||
destroyAILogger();
|
||||
KillGLWindow();
|
||||
cleanup();
|
||||
return static_cast<int>(msg.wParam);
|
||||
}
|
||||
|
|
|
@ -201,20 +201,13 @@ SET_PROPERTY( TARGET assimp PROPERTY DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX} )
|
|||
|
||||
IF( WIN32 )
|
||||
SET( platform_libs )
|
||||
ELSE( WIN32 )
|
||||
ELSE()
|
||||
SET( platform_libs pthread )
|
||||
ENDIF( WIN32 )
|
||||
|
||||
IF( WIN32 )
|
||||
ADD_CUSTOM_COMMAND(TARGET unit
|
||||
PRE_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:assimp> $<TARGET_FILE_DIR:unit>
|
||||
MAIN_DEPENDENCY assimp)
|
||||
ENDIF( WIN32 )
|
||||
ENDIF()
|
||||
|
||||
IF(MSVC)
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
ENDIF(MSVC)
|
||||
ENDIF()
|
||||
|
||||
target_link_libraries( unit assimp ${platform_libs} )
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ FOREACH( HEADER ${headers} )
|
|||
# add library
|
||||
add_library( ${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_FILE} )
|
||||
list(APPEND headerchecklibs ${TEST_NAME})
|
||||
ENDFOREACH( HEADER )
|
||||
ENDFOREACH()
|
||||
|
||||
add_custom_target(headercheck DEPENDS ${headerchecklibs})
|
||||
|
||||
|
|
|
@ -61,13 +61,6 @@ ADD_EXECUTABLE( assimp_cmd
|
|||
|
||||
SET_PROPERTY(TARGET assimp_cmd PROPERTY DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
|
||||
|
||||
IF( WIN32 )
|
||||
ADD_CUSTOM_COMMAND(TARGET assimp_cmd
|
||||
PRE_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:assimp> $<TARGET_FILE_DIR:assimp_cmd>
|
||||
MAIN_DEPENDENCY assimp)
|
||||
ENDIF( WIN32 )
|
||||
|
||||
TARGET_LINK_LIBRARIES( assimp_cmd assimp ${ZLIB_LIBRARIES} )
|
||||
SET_TARGET_PROPERTIES( assimp_cmd PROPERTIES
|
||||
OUTPUT_NAME assimp
|
||||
|
|
|
@ -90,14 +90,7 @@ IF ( MSVC )
|
|||
ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS )
|
||||
# assimp_viewer is ANSI (MBCS) throughout
|
||||
REMOVE_DEFINITIONS( -DUNICODE -D_UNICODE )
|
||||
ENDIF ( MSVC )
|
||||
|
||||
|
||||
#
|
||||
ADD_CUSTOM_COMMAND(TARGET assimp_viewer
|
||||
PRE_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:assimp> $<TARGET_FILE_DIR:assimp_viewer>
|
||||
MAIN_DEPENDENCY assimp)
|
||||
ENDIF ()
|
||||
|
||||
# Link the executable to the assimp + dx libs.
|
||||
TARGET_LINK_LIBRARIES ( assimp_viewer assimp ${DirectX_LIBRARY} ${DirectX_D3DX9_LIBRARY} comctl32.lib winmm.lib )
|
||||
|
|
Loading…
Reference in New Issue