diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
index e0c2bec9e..84e3123fe 100644
--- a/.github/FUNDING.yml
+++ b/.github/FUNDING.yml
@@ -1,2 +1,3 @@
patreon: assimp
custom: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4JRJVPXC4QJM4
+open_collective: assimp
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 000000000..dd84ea782
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,38 @@
+---
+name: Bug report
+about: Create a report to help us improve
+title: ''
+labels: ''
+assignees: ''
+
+---
+
+**Describe the bug**
+A clear and concise description of what the bug is.
+
+**To Reproduce**
+Steps to reproduce the behavior:
+1. Go to '...'
+2. Click on '....'
+3. Scroll down to '....'
+4. See error
+
+**Expected behavior**
+A clear and concise description of what you expected to happen.
+
+**Screenshots**
+If applicable, add screenshots to help explain your problem.
+
+**Desktop (please complete the following information):**
+ - OS: [e.g. iOS]
+ - Browser [e.g. chrome, safari]
+ - Version [e.g. 22]
+
+**Smartphone (please complete the following information):**
+ - Device: [e.g. iPhone6]
+ - OS: [e.g. iOS8.1]
+ - Browser [e.g. stock browser, safari]
+ - Version [e.g. 22]
+
+**Additional context**
+Add any other context about the problem here.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 000000000..bbcbbe7d6
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,20 @@
+---
+name: Feature request
+about: Suggest an idea for this project
+title: ''
+labels: ''
+assignees: ''
+
+---
+
+**Is your feature request related to a problem? Please describe.**
+A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+
+**Describe the solution you'd like**
+A clear and concise description of what you want to happen.
+
+**Describe alternatives you've considered**
+A clear and concise description of any alternative solutions or features you've considered.
+
+**Additional context**
+Add any other context or screenshots about the feature request here.
diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml
index 15f7643ce..08292d55f 100644
--- a/.github/workflows/ccpp.yml
+++ b/.github/workflows/ccpp.yml
@@ -7,40 +7,53 @@ on:
branches: [ master ]
jobs:
- linux:
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v1
- - name: configure
- run: cmake CMakeLists.txt
- - name: build
- run: cmake --build .
- - name: test
- run: cd bin && ./unit
-
- mac:
- runs-on: macos-latest
-
- steps:
- - uses: actions/checkout@v1
- - name: configure
- run: cmake CMakeLists.txt
- - name: build
- run: cmake --build .
- - name: test
- run: cd bin && ./unit
+ job:
+ name: ${{ matrix.os }}-${{ matrix.cxx }}-build-and-test
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ name: [ubuntu-gcc, macos-clang, windows-msvc, ubuntu-clang]
+ # For Windows msvc, for Linux and macOS let's use the clang compiler, use gcc for Linux.
+ include:
+ - name: windows-msvc
+ os: windows-latest
+ cxx: cl.exe
+ cc: cl.exe
+ - name: ubuntu-clang
+ os: ubuntu-latest
+ cxx: clang++
+ cc: clang
+ - name: macos-clang
+ os: macos-latest
+ cxx: clang++
+ cc: clang
+ - name: ubuntu-gcc
+ os: ubuntu-latest
+ cxx: g++
+ cc: gcc
- windows:
- runs-on: windows-latest
-
steps:
- - uses: actions/checkout@v1
- - name: configure
- run: cmake CMakeLists.txt
- - name: build
- run: cmake --build . --config Release
+ - uses: actions/checkout@v2
+
+ - uses: lukka/get-cmake@latest
+
+ - uses: ilammy/msvc-dev-cmd@v1
+
+ - uses: lukka/set-shell-env@v1
+ with:
+ CXX: ${{ matrix.cxx }}
+ CC: ${{ matrix.cc }}
+
+ - name: configure and build
+ uses: lukka/run-cmake@v2
+ with:
+ cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
+ cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
+ cmakeAppendedArgs: '-GNinja -DCMAKE_BUILD_TYPE=Release'
+ buildWithCMakeArgs: '-- -v'
+ buildDirectory: '${{ github.workspace }}/build/'
+
- name: test
- run: |
- cd bin\Release
- .\unit
+ run: cd build/bin && ./unit
+ shell: bash
diff --git a/.github/workflows/sanitizer.yml b/.github/workflows/sanitizer.yml
new file mode 100644
index 000000000..9bba5f6fd
--- /dev/null
+++ b/.github/workflows/sanitizer.yml
@@ -0,0 +1,56 @@
+name: C/C++ Sanitizer
+
+on:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+
+jobs:
+ job1:
+ name: adress-sanitizer
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: lukka/get-cmake@latest
+ - uses: lukka/set-shell-env@v1
+ with:
+ CXX: clang++
+ CC: clang
+
+ - name: configure and build
+ uses: lukka/run-cmake@v2
+ with:
+ cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
+ cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
+ cmakeAppendedArgs: '-GNinja -DCMAKE_BUILD_TYPE=Debug -DASSIMP_ASAN=ON'
+ buildWithCMakeArgs: '-- -v'
+ buildDirectory: '${{ github.workspace }}/build/'
+
+ - name: test
+ run: cd build/bin && ./unit
+ shell: bash
+
+ job2:
+ name: undefined-behavior-sanitizer
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: lukka/get-cmake@latest
+ - uses: lukka/set-shell-env@v1
+ with:
+ CXX: clang++
+ CC: clang
+
+ - name: configure and build
+ uses: lukka/run-cmake@v2
+ with:
+ cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
+ cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
+ cmakeAppendedArgs: '-GNinja -DCMAKE_BUILD_TYPE=Debug -DASSIMP_UBSAN=ON'
+ buildWithCMakeArgs: '-- -v'
+ buildDirectory: '${{ github.workspace }}/build/'
+
+ - name: test
+ run: cd build/bin && ./unit
+ shell: bash
diff --git a/.gitignore b/.gitignore
index e975976bf..fe59f9a70 100644
--- a/.gitignore
+++ b/.gitignore
@@ -79,6 +79,12 @@ test/gtest/src/gtest-stamp/Debug/
tools/assimp_view/assimp_viewer.vcxproj.user
*.pyc
+### Rust ###
+# Generated by Cargo; will have compiled files and executables
+port/assimp_rs/target/
+# Backup files generated by rustfmt
+port/assimp_rs/**/*.rs.bk
+
# Unix editor backups
*~
test/gtest/src/gtest-stamp/gtest-gitinfo.txt
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 640f89e64..6b350f6e3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -108,10 +108,6 @@ OPTION ( ASSIMP_ERROR_MAX
"Enable all warnings."
OFF
)
-OPTION ( ASSIMP_WERROR
- "Treat warnings as errors."
- OFF
-)
OPTION ( ASSIMP_ASAN
"Enable AddressSanitizer."
OFF
@@ -138,6 +134,12 @@ OPTION ( ASSIMP_IGNORE_GIT_HASH
OFF
)
+IF ( WIN32 )
+ OPTION ( ASSIMP_BUILD_ASSIMP_VIEW
+ "If the Assimp view tool is built. (requires DirectX)"
+ OFF )
+ENDIF()
+
IF (IOS AND NOT ASSIMP_HUNTER_ENABLED)
IF (NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE "Release")
@@ -238,14 +240,19 @@ SET(LIBASSIMP-DEV_COMPONENT "libassimp${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_M
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")
-# Grouped compiler settings
+IF( UNIX )
+ # Use GNUInstallDirs for Unix predefined directories
+ INCLUDE(GNUInstallDirs)
+ENDIF()
+
+# Grouped compiler settings ########################################
IF ((CMAKE_C_COMPILER_ID MATCHES "GNU") AND NOT CMAKE_COMPILER_IS_MINGW)
IF(NOT ASSIMP_HUNTER_ENABLED)
- SET(CMAKE_CXX_FLAGS "-fPIC -std=c++0x ${CMAKE_CXX_FLAGS}")
- SET(CMAKE_C_FLAGS "-fPIC ${CMAKE_C_FLAGS}")
+ SET(CMAKE_CXX_STANDARD 11)
+ SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
ENDIF()
# hide all not-exported symbols
- SET(CMAKE_CXX_FLAGS "-g -fvisibility=hidden -fno-strict-aliasing -Wall ${CMAKE_CXX_FLAGS}")
+ SET(CMAKE_CXX_FLAGS "-fvisibility=hidden -fno-strict-aliasing -Wall ${CMAKE_CXX_FLAGS}")
SET(CMAKE_C_FLAGS "-fno-strict-aliasing ${CMAKE_C_FLAGS}")
SET(LIBSTDC++_LIBRARIES -lstdc++)
ELSEIF(MSVC)
@@ -258,10 +265,10 @@ ELSEIF(MSVC)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /D_DEBUG /Zi /Od")
ELSEIF ( "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
IF(NOT ASSIMP_HUNTER_ENABLED)
- SET(CMAKE_CXX_FLAGS "-fPIC -std=c++11 ${CMAKE_CXX_FLAGS}")
- SET(CMAKE_C_FLAGS "-fPIC ${CMAKE_C_FLAGS}")
+ SET(CMAKE_CXX_STANDARD 11)
+ SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
ENDIF()
- SET(CMAKE_CXX_FLAGS "-g -fvisibility=hidden -fno-strict-aliasing -Wall -Wno-long-long ${CMAKE_CXX_FLAGS}" )
+ SET(CMAKE_CXX_FLAGS "-fvisibility=hidden -fno-strict-aliasing -Wall -Wno-long-long ${CMAKE_CXX_FLAGS}" )
SET(CMAKE_C_FLAGS "-fno-strict-aliasing ${CMAKE_C_FLAGS}")
ELSEIF( CMAKE_COMPILER_IS_MINGW )
IF (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
@@ -306,16 +313,6 @@ IF (ASSIMP_ERROR_MAX)
ENDIF()
ENDIF()
-IF (ASSIMP_WERROR)
- MESSAGE(STATUS "Treating warnings as errors")
- IF (MSVC)
- ADD_COMPILE_OPTIONS(/WX)
- ELSE()
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
- ENDIF()
-ENDIF()
-
IF (ASSIMP_ASAN)
MESSAGE(STATUS "AddressSanitizer enabled")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
@@ -521,19 +518,19 @@ ENDIF()
SET ( ASSIMP_BUILD_ARCHITECTURE "" CACHE STRING
"describe the current architecture."
)
-IF ( ASSIMP_BUILD_ARCHITECTURE STREQUAL "")
-ELSE ()
+IF( ASSIMP_BUILD_ARCHITECTURE STREQUAL "")
+ELSE()
ADD_DEFINITIONS ( -D'ASSIMP_BUILD_ARCHITECTURE="${ASSIMP_BUILD_ARCHITECTURE}"' )
-ENDIF ()
+ENDIF()
# ${CMAKE_GENERATOR}
SET ( ASSIMP_BUILD_COMPILER "" CACHE STRING
"describe the current compiler."
)
-IF ( ASSIMP_BUILD_COMPILER STREQUAL "")
-ELSE ()
+IF( ASSIMP_BUILD_COMPILER STREQUAL "")
+ELSE()
ADD_DEFINITIONS ( -D'ASSIMP_BUILD_COMPILER="${ASSIMP_BUILD_COMPILER}"' )
-ENDIF ()
+ENDIF()
MARK_AS_ADVANCED ( ASSIMP_BUILD_ARCHITECTURE ASSIMP_BUILD_COMPILER )
diff --git a/INSTALL b/INSTALL
index 350a5f109..ecec2585b 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,50 +1,50 @@
-
-========================================================================
-Open Asset Import Library (assimp) INSTALL
-========================================================================
-
-------------------------------
-Getting the documentation
-------------------------------
-
-A regularly-updated copy is available at
-http://assimp.sourceforge.net/lib_html/index.html
-
-A CHM file is included in the SVN repos: ./doc/AssimpDoc_Html/AssimpDoc.chm.
-To build the doxygen documentation on your own, follow these steps:
-
-a) download & install latest doxygen
-b) make sure doxygen is in the executable search path
-c) navigate to ./doc
-d) and run 'doxygen'
-
-Open the generated HTML (AssimpDoc_Html/index.html) in the browser of your choice.
-Windows only: To generate the CHM doc, install 'Microsoft HTML Workshop'
-and configure the path to it in the DOXYFILE first.
-
-------------------------------
-Building Assimp
-------------------------------
-
-More detailed build instructions can be found in the documentation,
-this section is just for the inpatient among you.
-
-CMake is the preferred build system for Assimp. The minimum required version
-is 2.6. If you don't have it yet, downloads for CMake can be found on
-http://www.cmake.org/.
-
-For Unix:
-
-1. mkdir build && cd build
-2. cmake .. -G 'Unix Makefiles'
-3. make -j4
-
-For Windows:
-1. Open a command prompt
-2. mkdir build
-3. cd build
-4. cmake ..
-5. cmake --build .
-
-For iOS:
-Just check the following project, which deploys a compiler toolchain for different iOS-versions: https://github.com/assimp/assimp/tree/master/port/iOS
+
+========================================================================
+Open Asset Import Library (assimp) INSTALL
+========================================================================
+
+------------------------------
+Getting the documentation
+------------------------------
+
+A regularly-updated copy is available at
+http://assimp.sourceforge.net/lib_html/index.html
+
+A CHM file is included in the SVN repos: ./doc/AssimpDoc_Html/AssimpDoc.chm.
+To build the doxygen documentation on your own, follow these steps:
+
+a) download & install latest doxygen
+b) make sure doxygen is in the executable search path
+c) navigate to ./doc
+d) and run 'doxygen'
+
+Open the generated HTML (AssimpDoc_Html/index.html) in the browser of your choice.
+Windows only: To generate the CHM doc, install 'Microsoft HTML Workshop'
+and configure the path to it in the DOXYFILE first.
+
+------------------------------
+Building Assimp
+------------------------------
+
+More detailed build instructions can be found in the documentation,
+this section is just for the inpatient among you.
+
+CMake is the preferred build system for Assimp. The minimum required version
+is 2.6. If you don't have it yet, downloads for CMake can be found on
+http://www.cmake.org/.
+
+For Unix:
+
+1. mkdir build && cd build
+2. cmake .. -G 'Unix Makefiles'
+3. make -j4
+
+For Windows:
+1. Open a command prompt
+2. mkdir build
+3. cd build
+4. cmake ..
+5. cmake --build .
+
+For iOS:
+Just check the following project, which deploys a compiler toolchain for different iOS-versions: https://github.com/assimp/assimp/tree/master/port/iOS
diff --git a/Readme.md b/Readme.md
index 61fff538f..15e76b9d2 100644
--- a/Readme.md
+++ b/Readme.md
@@ -2,6 +2,7 @@ Open Asset Import Library (assimp)
==================================
A library to import and export various 3d-model-formats including scene-post-processing to generate missing render data.
### Current project status ###
+[![Financial Contributors on Open Collective](https://opencollective.com/assimp/all/badge.svg?label=financial+contributors)](https://opencollective.com/assimp)
![C/C++ CI](https://github.com/assimp/assimp/workflows/C/C++%20CI/badge.svg)
[![Linux Build Status](https://travis-ci.org/assimp/assimp.svg)](https://travis-ci.org/assimp/assimp)
[![Windows Build Status](https://ci.appveyor.com/api/projects/status/tmo433wax6u6cjp4?svg=true)](https://ci.appveyor.com/project/kimkulling/assimp)
@@ -179,6 +180,28 @@ And we also have a Gitter-channel:Gitter [![Join the chat at https://gitter.im/a
Contributions to assimp are highly appreciated. The easiest way to get involved is to submit
a pull request with your changes against the main repository's `master` branch.
+## Contributors
+
+### Code Contributors
+
+This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
+
+
+
+### Financial Contributors
+
+Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/assimp/contribute)]
+
+#### Individuals
+
+
+
+#### Organizations
+
+Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/assimp/contribute)]
+
+
+
### License ###
Our license is based on the modified, __3-clause BSD__-License.
diff --git a/assimpTargets-debug.cmake.in b/assimpTargets-debug.cmake.in
index 2488c1f57..b7efe71f9 100644
--- a/assimpTargets-debug.cmake.in
+++ b/assimpTargets-debug.cmake.in
@@ -7,6 +7,8 @@ set(CMAKE_IMPORT_FILE_VERSION 1)
set(ASSIMP_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
+get_property(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
+
if(MSVC)
if(MSVC_TOOLSET_VERSION)
set(MSVC_PREFIX "vc${MSVC_TOOLSET_VERSION}")
@@ -35,8 +37,6 @@ if(MSVC)
endif()
set(ASSIMP_LIBRARY_SUFFIX "@ASSIMP_LIBRARY_SUFFIX@-${MSVC_PREFIX}-mt" CACHE STRING "the suffix for the assimp windows library" )
- file(TO_NATIVE_PATH "${_IMPORT_PREFIX}" _IMPORT_PREFIX)
-
if(ASSIMP_BUILD_SHARED_LIBS)
set(sharedLibraryName "assimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_DEBUG_POSTFIX@@CMAKE_SHARED_LIBRARY_SUFFIX@")
set(importLibraryName "assimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_DEBUG_POSTFIX@@CMAKE_IMPORT_LIBRARY_SUFFIX@")
@@ -73,6 +73,9 @@ else()
else()
set(sharedLibraryName "libassimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_DEBUG_POSTFIX@@CMAKE_SHARED_LIBRARY_SUFFIX@.@ASSIMP_VERSION_MAJOR@")
endif()
+
+ # Import target "assimp::assimp" for configuration "Debug"
+ set_property(TARGET assimp::assimp APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(assimp::assimp PROPERTIES
IMPORTED_SONAME_DEBUG "${sharedLibraryName}"
IMPORTED_LOCATION_DEBUG "@CMAKE_INSTALL_FULL_LIBDIR@/${sharedLibraryName}"
@@ -81,6 +84,9 @@ else()
list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "@CMAKE_INSTALL_FULL_LIBDIR@/${sharedLibraryName}" )
else()
set(staticLibraryName "libassimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_DEBUG_POSTFIX@@CMAKE_STATIC_LIBRARY_SUFFIX@")
+
+ # Import target "assimp::assimp" for configuration "Debug"
+ set_property(TARGET assimp::assimp APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(assimp::assimp PROPERTIES
IMPORTED_LOCATION_DEBUG "@CMAKE_INSTALL_FULL_LIBDIR@/${staticLibraryName}"
)
@@ -89,9 +95,6 @@ else()
endif()
endif()
-
-
-
# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)
diff --git a/assimpTargets-release.cmake.in b/assimpTargets-release.cmake.in
index a4555e326..c716006dd 100644
--- a/assimpTargets-release.cmake.in
+++ b/assimpTargets-release.cmake.in
@@ -7,6 +7,8 @@ set(CMAKE_IMPORT_FILE_VERSION 1)
set(ASSIMP_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
+get_property(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
+
if(MSVC)
if(MSVC_TOOLSET_VERSION)
set(MSVC_PREFIX "vc${MSVC_TOOLSET_VERSION}")
@@ -34,8 +36,6 @@ if(MSVC)
endif()
endif()
set(ASSIMP_LIBRARY_SUFFIX "@ASSIMP_LIBRARY_SUFFIX@-${MSVC_PREFIX}-mt" CACHE STRING "the suffix for the assimp windows library" )
-
- file(TO_NATIVE_PATH "${_IMPORT_PREFIX}" _IMPORT_PREFIX)
if(ASSIMP_BUILD_SHARED_LIBS)
set(sharedLibraryName "assimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_SHARED_LIBRARY_SUFFIX@")
@@ -56,7 +56,7 @@ if(MSVC)
# Import target "assimp::assimp" for configuration "Release"
set_property(TARGET assimp::assimp APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(assimp::assimp PROPERTIES
- IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/${staticLibraryName}"
+ IMPORTED_LOCATION_RELEASE "@CMAKE_INSTALL_FULL_LIBDIR@/${staticLibraryName}"
)
list(APPEND _IMPORT_CHECK_TARGETS assimp::assimp )
list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "@CMAKE_INSTALL_FULL_LIBDIR@/${staticLibraryName}")
@@ -73,6 +73,9 @@ else()
else()
set(sharedLibraryName "libassimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_SHARED_LIBRARY_SUFFIX@.@ASSIMP_VERSION_MAJOR@")
endif()
+
+ # Import target "assimp::assimp" for configuration "Release"
+ set_property(TARGET assimp::assimp APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(assimp::assimp PROPERTIES
IMPORTED_SONAME_RELEASE "${sharedLibraryName}"
IMPORTED_LOCATION_RELEASE "@CMAKE_INSTALL_FULL_LIBDIR@/${sharedLibraryName}"
@@ -81,6 +84,9 @@ else()
list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "@CMAKE_INSTALL_FULL_LIBDIR@/${sharedLibraryName}" )
else()
set(staticLibraryName "libassimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_STATIC_LIBRARY_SUFFIX@")
+
+ # Import target "assimp::assimp" for configuration "Release"
+ set_property(TARGET assimp::assimp APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(assimp::assimp PROPERTIES
IMPORTED_LOCATION_RELEASE "@CMAKE_INSTALL_FULL_LIBDIR@/${staticLibraryName}"
)
diff --git a/code/AMF/AMFImporter_Postprocess.cpp b/code/AMF/AMFImporter_Postprocess.cpp
deleted file mode 100644
index 273b8e0c4..000000000
--- a/code/AMF/AMFImporter_Postprocess.cpp
+++ /dev/null
@@ -1,978 +0,0 @@
-/*
----------------------------------------------------------------------------
-Open Asset Import Library (assimp)
----------------------------------------------------------------------------
-
-Copyright (c) 2006-2020, assimp team
-
-
-
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms,
-with or without modification, are permitted provided that the following
-conditions are met:
-
-* Redistributions of source code must retain the above
-copyright notice, this list of conditions and the
-following disclaimer.
-
-* Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the
-following disclaimer in the documentation and/or other
-materials provided with the distribution.
-
-* Neither the name of the assimp team, nor the names of its
-contributors may be used to endorse or promote products
-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
-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,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
----------------------------------------------------------------------------
-*/
-
-/// \file AMFImporter_Postprocess.cpp
-/// \brief Convert built scenegraph and objects to Assimp scenegraph.
-/// \date 2016
-/// \author smal.root@gmail.com
-
-#ifndef ASSIMP_BUILD_NO_AMF_IMPORTER
-
-#include "AMFImporter.hpp"
-
-// Header files, Assimp.
-#include
-#include
-#include
-
-// Header files, stdlib.
-#include
-
-namespace Assimp
-{
-
-aiColor4D AMFImporter::SPP_Material::GetColor(const float /*pX*/, const float /*pY*/, const float /*pZ*/) const
-{
- aiColor4D tcol;
-
- // Check if stored data are supported.
- if(!Composition.empty())
- {
- throw DeadlyImportError("IME. GetColor for composition");
- }
- else if(Color->Composed)
- {
- throw DeadlyImportError("IME. GetColor, composed color");
- }
- else
- {
- tcol = Color->Color;
- }
-
- // Check if default color must be used
- if((tcol.r == 0) && (tcol.g == 0) && (tcol.b == 0) && (tcol.a == 0))
- {
- tcol.r = 0.5f;
- tcol.g = 0.5f;
- tcol.b = 0.5f;
- tcol.a = 1;
- }
-
- return tcol;
-}
-
-void AMFImporter::PostprocessHelper_CreateMeshDataArray(const CAMFImporter_NodeElement_Mesh& pNodeElement, std::vector& pVertexCoordinateArray,
- std::vector& pVertexColorArray) const
-{
- CAMFImporter_NodeElement_Vertices* vn = nullptr;
- size_t col_idx;
-
- // All data stored in "vertices", search for it.
- for(CAMFImporter_NodeElement* ne_child: pNodeElement.Child)
- {
- if(ne_child->Type == CAMFImporter_NodeElement::ENET_Vertices) vn = (CAMFImporter_NodeElement_Vertices*)ne_child;
- }
-
- // If "vertices" not found then no work for us.
- if(vn == nullptr) return;
-
- pVertexCoordinateArray.reserve(vn->Child.size());// all coordinates stored as child and we need to reserve space for future push_back's.
- pVertexColorArray.resize(vn->Child.size());// colors count equal vertices count.
- col_idx = 0;
- // Inside vertices collect all data and place to arrays
- for(CAMFImporter_NodeElement* vn_child: vn->Child)
- {
- // vertices, colors
- if(vn_child->Type == CAMFImporter_NodeElement::ENET_Vertex)
- {
- // by default clear color for current vertex
- pVertexColorArray[col_idx] = nullptr;
-
- for(CAMFImporter_NodeElement* vtx: vn_child->Child)
- {
- if(vtx->Type == CAMFImporter_NodeElement::ENET_Coordinates)
- {
- pVertexCoordinateArray.push_back(((CAMFImporter_NodeElement_Coordinates*)vtx)->Coordinate);
-
- continue;
- }
-
- if(vtx->Type == CAMFImporter_NodeElement::ENET_Color)
- {
- pVertexColorArray[col_idx] = (CAMFImporter_NodeElement_Color*)vtx;
-
- continue;
- }
- }// for(CAMFImporter_NodeElement* vtx: vn_child->Child)
-
- col_idx++;
- }// if(vn_child->Type == CAMFImporter_NodeElement::ENET_Vertex)
- }// for(CAMFImporter_NodeElement* vn_child: vn->Child)
-}
-
-size_t AMFImporter::PostprocessHelper_GetTextureID_Or_Create(const std::string& pID_R, const std::string& pID_G, const std::string& pID_B,
- const std::string& pID_A)
-{
- size_t TextureConverted_Index;
- std::string TextureConverted_ID;
-
- // check input data
- if(pID_R.empty() && pID_G.empty() && pID_B.empty() && pID_A.empty())
- throw DeadlyImportError("PostprocessHelper_GetTextureID_Or_Create. At least one texture ID must be defined.");
-
- // Create ID
- TextureConverted_ID = pID_R + "_" + pID_G + "_" + pID_B + "_" + pID_A;
- // Check if texture specified by set of IDs is converted already.
- TextureConverted_Index = 0;
- for(const SPP_Texture& tex_convd: mTexture_Converted)
- {
- if ( tex_convd.ID == TextureConverted_ID ) {
- return TextureConverted_Index;
- } else {
- ++TextureConverted_Index;
- }
- }
-
- //
- // Converted texture not found, create it.
- //
- CAMFImporter_NodeElement_Texture* src_texture[4]{nullptr};
- std::vector src_texture_4check;
- SPP_Texture converted_texture;
-
- {// find all specified source textures
- CAMFImporter_NodeElement* t_tex;
-
- // R
- if(!pID_R.empty())
- {
- if(!Find_NodeElement(pID_R, CAMFImporter_NodeElement::ENET_Texture, &t_tex)) Throw_ID_NotFound(pID_R);
-
- src_texture[0] = (CAMFImporter_NodeElement_Texture*)t_tex;
- src_texture_4check.push_back((CAMFImporter_NodeElement_Texture*)t_tex);
- }
- else
- {
- src_texture[0] = nullptr;
- }
-
- // G
- if(!pID_G.empty())
- {
- if(!Find_NodeElement(pID_G, CAMFImporter_NodeElement::ENET_Texture, &t_tex)) Throw_ID_NotFound(pID_G);
-
- src_texture[1] = (CAMFImporter_NodeElement_Texture*)t_tex;
- src_texture_4check.push_back((CAMFImporter_NodeElement_Texture*)t_tex);
- }
- else
- {
- src_texture[1] = nullptr;
- }
-
- // B
- if(!pID_B.empty())
- {
- if(!Find_NodeElement(pID_B, CAMFImporter_NodeElement::ENET_Texture, &t_tex)) Throw_ID_NotFound(pID_B);
-
- src_texture[2] = (CAMFImporter_NodeElement_Texture*)t_tex;
- src_texture_4check.push_back((CAMFImporter_NodeElement_Texture*)t_tex);
- }
- else
- {
- src_texture[2] = nullptr;
- }
-
- // A
- if(!pID_A.empty())
- {
- if(!Find_NodeElement(pID_A, CAMFImporter_NodeElement::ENET_Texture, &t_tex)) Throw_ID_NotFound(pID_A);
-
- src_texture[3] = (CAMFImporter_NodeElement_Texture*)t_tex;
- src_texture_4check.push_back((CAMFImporter_NodeElement_Texture*)t_tex);
- }
- else
- {
- src_texture[3] = nullptr;
- }
- }// END: find all specified source textures
-
- // check that all textures has same size
- if(src_texture_4check.size() > 1)
- {
- for (size_t i = 0, i_e = (src_texture_4check.size() - 1); i < i_e; i++)
- {
- if((src_texture_4check[i]->Width != src_texture_4check[i + 1]->Width) || (src_texture_4check[i]->Height != src_texture_4check[i + 1]->Height) ||
- (src_texture_4check[i]->Depth != src_texture_4check[i + 1]->Depth))
- {
- throw DeadlyImportError("PostprocessHelper_GetTextureID_Or_Create. Source texture must has the same size.");
- }
- }
- }// if(src_texture_4check.size() > 1)
-
- // set texture attributes
- converted_texture.Width = src_texture_4check[0]->Width;
- converted_texture.Height = src_texture_4check[0]->Height;
- converted_texture.Depth = src_texture_4check[0]->Depth;
- // if one of source texture is tiled then converted texture is tiled too.
- converted_texture.Tiled = false;
- for(uint8_t i = 0; i < src_texture_4check.size(); i++) converted_texture.Tiled |= src_texture_4check[i]->Tiled;
-
- // Create format hint.
- strcpy(converted_texture.FormatHint, "rgba0000");// copy initial string.
- if(!pID_R.empty()) converted_texture.FormatHint[4] = '8';
- if(!pID_G.empty()) converted_texture.FormatHint[5] = '8';
- if(!pID_B.empty()) converted_texture.FormatHint[6] = '8';
- if(!pID_A.empty()) converted_texture.FormatHint[7] = '8';
-
- //
- // Сopy data of textures.
- //
- size_t tex_size = 0;
- size_t step = 0;
- size_t off_g = 0;
- size_t off_b = 0;
-
- // Calculate size of the target array and rule how data will be copied.
- if(!pID_R.empty() && nullptr != src_texture[ 0 ] ) {
- tex_size += src_texture[0]->Data.size(); step++, off_g++, off_b++;
- }
- if(!pID_G.empty() && nullptr != src_texture[ 1 ] ) {
- tex_size += src_texture[1]->Data.size(); step++, off_b++;
- }
- if(!pID_B.empty() && nullptr != src_texture[ 2 ] ) {
- tex_size += src_texture[2]->Data.size(); step++;
- }
- if(!pID_A.empty() && nullptr != src_texture[ 3 ] ) {
- tex_size += src_texture[3]->Data.size(); step++;
- }
-
- // Create target array.
- converted_texture.Data = new uint8_t[tex_size];
- // And copy data
- auto CopyTextureData = [&](const std::string& pID, const size_t pOffset, const size_t pStep, const uint8_t pSrcTexNum) -> void
- {
- if(!pID.empty())
- {
- for(size_t idx_target = pOffset, idx_src = 0; idx_target < tex_size; idx_target += pStep, idx_src++) {
- CAMFImporter_NodeElement_Texture* tex = src_texture[pSrcTexNum];
- ai_assert(tex);
- converted_texture.Data[idx_target] = tex->Data.at(idx_src);
- }
- }
- };// auto CopyTextureData = [&](const size_t pOffset, const size_t pStep, const uint8_t pSrcTexNum) -> void
-
- CopyTextureData(pID_R, 0, step, 0);
- CopyTextureData(pID_G, off_g, step, 1);
- CopyTextureData(pID_B, off_b, step, 2);
- CopyTextureData(pID_A, step - 1, step, 3);
-
- // Store new converted texture ID
- converted_texture.ID = TextureConverted_ID;
- // Store new converted texture
- mTexture_Converted.push_back(converted_texture);
-
- return TextureConverted_Index;
-}
-
-void AMFImporter::PostprocessHelper_SplitFacesByTextureID(std::list& pInputList, std::list >& pOutputList_Separated)
-{
- auto texmap_is_equal = [](const CAMFImporter_NodeElement_TexMap* pTexMap1, const CAMFImporter_NodeElement_TexMap* pTexMap2) -> bool
- {
- if((pTexMap1 == nullptr) && (pTexMap2 == nullptr)) return true;
- if(pTexMap1 == nullptr) return false;
- if(pTexMap2 == nullptr) return false;
-
- if(pTexMap1->TextureID_R != pTexMap2->TextureID_R) return false;
- if(pTexMap1->TextureID_G != pTexMap2->TextureID_G) return false;
- if(pTexMap1->TextureID_B != pTexMap2->TextureID_B) return false;
- if(pTexMap1->TextureID_A != pTexMap2->TextureID_A) return false;
-
- return true;
- };
-
- pOutputList_Separated.clear();
- if(pInputList.empty()) return;
-
- do
- {
- SComplexFace face_start = pInputList.front();
- std::list face_list_cur;
-
- for(std::list::iterator it = pInputList.begin(), it_end = pInputList.end(); it != it_end;)
- {
- if(texmap_is_equal(face_start.TexMap, it->TexMap))
- {
- auto it_old = it;
-
- ++it;
- face_list_cur.push_back(*it_old);
- pInputList.erase(it_old);
- }
- else
- {
- ++it;
- }
- }
-
- if(!face_list_cur.empty()) pOutputList_Separated.push_back(face_list_cur);
-
- } while(!pInputList.empty());
-}
-
-void AMFImporter::Postprocess_AddMetadata(const std::list& metadataList, aiNode& sceneNode) const
-{
- if ( !metadataList.empty() )
- {
- if(sceneNode.mMetaData != nullptr) throw DeadlyImportError("Postprocess. MetaData member in node are not nullptr. Something went wrong.");
-
- // copy collected metadata to output node.
- sceneNode.mMetaData = aiMetadata::Alloc( static_cast(metadataList.size()) );
- size_t meta_idx( 0 );
-
- for(const CAMFImporter_NodeElement_Metadata& metadata: metadataList)
- {
- sceneNode.mMetaData->Set(static_cast(meta_idx++), metadata.Type, aiString(metadata.Value));
- }
- }// if(!metadataList.empty())
-}
-
-void AMFImporter::Postprocess_BuildNodeAndObject(const CAMFImporter_NodeElement_Object& pNodeElement, std::list& pMeshList, aiNode** pSceneNode)
-{
-CAMFImporter_NodeElement_Color* object_color = nullptr;
-
- // create new aiNode and set name as