From fe6b3166953fd2fe8611fbfd8d4122297ed78cb9 Mon Sep 17 00:00:00 2001 From: Richard Date: Thu, 10 Jan 2019 17:27:54 +0000 Subject: [PATCH 01/34] Set MSVC projects to default to Unicode MBCS is deprecated and shouldn't be used in new projects --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a97174de4..9f9327a93 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -133,6 +133,8 @@ IF(MSVC) "Install MSVC debug files." ON ) + # Multibyte character set is deprecated, but default + ADD_DEFINITIONS( -DUNICODE -D_UNICODE ) ENDIF(MSVC) IF (BUILD_FRAMEWORK) From 3c651be6404c024fb70ed9b22243dea3fd3022de Mon Sep 17 00:00:00 2001 From: Richard Date: Thu, 17 Jan 2019 13:55:05 +0000 Subject: [PATCH 02/34] Exporter::ExportToBlob() Pass on preprocessing and properties. Issue #2302 --- code/Exporter.cpp | 4 ++-- include/assimp/Exporter.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/Exporter.cpp b/code/Exporter.cpp index 0acde75bf..0414f661c 100644 --- a/code/Exporter.cpp +++ b/code/Exporter.cpp @@ -288,7 +288,7 @@ void Exporter::SetProgressHandler(ProgressHandler* pHandler) { // ------------------------------------------------------------------------------------------------ const aiExportDataBlob* Exporter::ExportToBlob( const aiScene* pScene, const char* pFormatId, - unsigned int, const ExportProperties* /*pProperties*/ ) { + unsigned int pPreprocessing, const ExportProperties* pProperties) { if (pimpl->blob) { delete pimpl->blob; pimpl->blob = nullptr; @@ -298,7 +298,7 @@ const aiExportDataBlob* Exporter::ExportToBlob( const aiScene* pScene, const cha BlobIOSystem* blobio = new BlobIOSystem(); pimpl->mIOSystem = std::shared_ptr( blobio ); - if (AI_SUCCESS != Export(pScene,pFormatId,blobio->GetMagicFileName())) { + if (AI_SUCCESS != Export(pScene,pFormatId,blobio->GetMagicFileName(), pPreprocessing, pProperties)) { pimpl->mIOSystem = old; return nullptr; } diff --git a/include/assimp/Exporter.hpp b/include/assimp/Exporter.hpp index 4e0843b60..d254aae66 100644 --- a/include/assimp/Exporter.hpp +++ b/include/assimp/Exporter.hpp @@ -190,7 +190,7 @@ public: * @note Use aiCopyScene() to get a modifiable copy of a previously * imported scene. */ const aiExportDataBlob* ExportToBlob(const aiScene* pScene, const char* pFormatId, - unsigned int pPreprocessing = 0u, const ExportProperties* = nullptr); + unsigned int pPreprocessing = 0u, const ExportProperties* pProperties = nullptr); const aiExportDataBlob* ExportToBlob( const aiScene* pScene, const std::string& pFormatId, unsigned int pPreprocessing = 0u, const ExportProperties* pProperties = nullptr); From 3a610d3d66511c3ed35977f85625d5e8316c37df Mon Sep 17 00:00:00 2001 From: Rich ard Date: Fri, 8 Mar 2019 15:49:18 +0000 Subject: [PATCH 03/34] Embed version information under Windows --- .gitignore | 1 + code/CMakeLists.txt | 4 ++++ code/res/assimp.rc | 8 ++++---- revision.h.in | 11 +++++++++++ 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index d383f3ec8..49cd60ca8 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ CMakeLists.txt.user # Generated assimp.pc +assimp.aps revision.h contrib/zlib/zconf.h contrib/zlib/zlib.pc diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 37ad34b85..ee2602b54 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -145,6 +145,10 @@ SET( Core_SRCS Assimp.cpp ) +IF(MSVC) + list(APPEND Core_SRCS "res/assimp.rc") +ENDIF(MSVC) + SET( Logging_SRCS ${HEADER_PATH}/DefaultLogger.hpp ${HEADER_PATH}/LogStream.hpp diff --git a/code/res/assimp.rc b/code/res/assimp.rc index 0fe98c05d..ae0c87b8a 100644 --- a/code/res/assimp.rc +++ b/code/res/assimp.rc @@ -31,8 +31,8 @@ LANGUAGE LANG_GERMAN, SUBLANG_GERMAN // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,1,SVNRevision, 0 - PRODUCTVERSION 1,1,SVNRevision,0 + FILEVERSION VER_FILEVERSION + PRODUCTVERSION VER_FILEVERSION FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -50,12 +50,12 @@ BEGIN VALUE "Comments", "Licensed under a 3-clause BSD license" VALUE "CompanyName", "assimp team" VALUE "FileDescription", "Open Asset Import Library" - VALUE "FileVersion", 1,1,SVNRevision,0 + VALUE "FileVersion", VER_FILEVERSION VALUE "InternalName", "assimp " VALUE "LegalCopyright", "Copyright (C) 2006-2010" VALUE "OriginalFilename", "assimpNN.dll" VALUE "ProductName", "Open Asset Import Library" - VALUE "ProductVersion", 1,1,SVNRevision,0 + VALUE "ProductVersion", VER_FILEVERSION_STR ,0 END END diff --git a/revision.h.in b/revision.h.in index 87c41fa89..0ad58feb7 100644 --- a/revision.h.in +++ b/revision.h.in @@ -4,4 +4,15 @@ #define GitVersion 0x@GIT_COMMIT_HASH@ #define GitBranch "@GIT_BRANCH@" +#define VER_MAJOR @ASSIMP_VERSION_MAJOR@ +#define VER_MINOR @ASSIMP_VERSION_MINOR@ +#define VER_PATCH @ASSIMP_VERSION_PATCH@ +#define VER_BUILD @ASSIMP_PACKAGE_VERSION@ + +#define STR_HELP(x) #x +#define STR(x) STR_HELP(x) + +#define VER_FILEVERSION VER_MAJOR,VER_MINOR,VER_PATCH,VER_BUILD +#define VER_FILEVERSION_STR STR(VER_MAJOR) "." STR(VER_MINOR) "." STR(VER_PATCH) "." STR(VER_BUILD) + #endif // ASSIMP_REVISION_H_INC From 07bbb2c000587f9ebba78ddb1da2cf141134de2b Mon Sep 17 00:00:00 2001 From: Rich ard Date: Fri, 15 Mar 2019 10:18:43 +0000 Subject: [PATCH 04/34] Nicer name for Assimp Binary importer .assbin is not a nice name to show a user --- code/AssbinLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/AssbinLoader.cpp b/code/AssbinLoader.cpp index 7adb8db6f..c68daf101 100644 --- a/code/AssbinLoader.cpp +++ b/code/AssbinLoader.cpp @@ -68,7 +68,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using namespace Assimp; static const aiImporterDesc desc = { - ".assbin Importer", + "Assimp Binary Importer", "Gargaj / Conspiracy", "", "", From d66166675a5845d8be78f7b8c42c00bb519df9d5 Mon Sep 17 00:00:00 2001 From: RichardTea <31507749+RichardTea@users.noreply.github.com> Date: Mon, 8 Apr 2019 17:11:50 +0100 Subject: [PATCH 05/34] first pass at collada metadata --- code/ColladaLoader.cpp | 6 ++++++ code/ColladaParser.cpp | 17 +++++++++++++++-- code/ColladaParser.h | 3 +++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/code/ColladaLoader.cpp b/code/ColladaLoader.cpp index 6837dca4a..47a40f5d9 100644 --- a/code/ColladaLoader.cpp +++ b/code/ColladaLoader.cpp @@ -207,6 +207,12 @@ void ColladaLoader::InternReadFile( const std::string& pFile, aiScene* pScene, I 0, 0, 0, 1); } + // Store scene metadata + for (auto it = parser.mAssetMetaData.cbegin(); it != parser.mAssetMetaData.cend(); ++it) + { + pScene->mMetaData->Add((*it).first, (*it).second); + } + // store all meshes StoreSceneMeshes( pScene); diff --git a/code/ColladaParser.cpp b/code/ColladaParser.cpp index 0fa59362b..c38d18283 100644 --- a/code/ColladaParser.cpp +++ b/code/ColladaParser.cpp @@ -264,9 +264,22 @@ void ColladaParser::ReadAssetInfo() // check element end TestClosing( "up_axis"); - } else + } + else if(IsElement("contributor")) { - SkipElement(); + // This has no data of its own, will get children next time through + } + else + { + const char* metadata_key = mReader->getNodeName(); + const char* metadata_value = TestTextContent(); + if (metadata_key != nullptr && metadata_value != nullptr) + { + aiString aistr; + aistr.Set(metadata_value); + mAssetMetaData.emplace(metadata_key, aistr); + } + //SkipElement(); } } else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) diff --git a/code/ColladaParser.h b/code/ColladaParser.h index 232d85654..9fdca86c8 100644 --- a/code/ColladaParser.h +++ b/code/ColladaParser.h @@ -343,6 +343,9 @@ namespace Assimp /** Which is the up vector */ enum { UP_X, UP_Y, UP_Z } mUpDirection; + typedef std::map AssetMetaData; + AssetMetaData mAssetMetaData; + /** Collada file format version */ Collada::FormatVersion mFormat; }; From 1f55bdd9a7ac5e512599bc775793dc4e41adfaa9 Mon Sep 17 00:00:00 2001 From: RichardTea <31507749+RichardTea@users.noreply.github.com> Date: Tue, 9 Apr 2019 16:28:15 +0100 Subject: [PATCH 06/34] Save/Load Collada 1.4 Root Asset Metadata Add Collada 1.4 metadata to export and import. Can store in the Scene or the Root Node for export, will be loaded into the Scene during Import --- code/ColladaExporter.cpp | 38 ++++++++++++++++-- code/ColladaLoader.cpp | 11 ++++-- code/ColladaParser.cpp | 83 ++++++++++++++++++++++++++++++++++------ code/ColladaParser.h | 16 +++++++- 4 files changed, 128 insertions(+), 20 deletions(-) diff --git a/code/ColladaExporter.cpp b/code/ColladaExporter.cpp index 37a6ba4e0..e7cc6907d 100644 --- a/code/ColladaExporter.cpp +++ b/code/ColladaExporter.cpp @@ -238,7 +238,11 @@ void ColladaExporter::WriteHeader() mOutput << startstr << "" << endstr; PushTag(); - aiMetadata* meta = mScene->mRootNode->mMetaData; + // If no Scene metadata, use root node metadata + aiMetadata* meta = mScene->mMetaData; + if (!meta) + meta = mScene->mRootNode->mMetaData; + aiString value; if (!meta || !meta->Get("Author", value)) mOutput << startstr << "" << "Assimp" << "" << endstr; @@ -250,13 +254,39 @@ void ColladaExporter::WriteHeader() else mOutput << startstr << "" << XMLEscape(value.C_Str()) << "" << endstr; - //mOutput << startstr << "" << mScene->author.C_Str() << "" << endstr; - //mOutput << startstr << "" << mScene->authoringTool.C_Str() << "" << endstr; + if (meta) + { + if (meta->Get("Comments", value)) + mOutput << startstr << "" << XMLEscape(value.C_Str()) << "" << endstr; + if (meta->Get("Copyright", value)) + mOutput << startstr << "" << XMLEscape(value.C_Str()) << "" << endstr; + if (meta->Get("SourceData", value)) + mOutput << startstr << "" << XMLEscape(value.C_Str()) << "" << endstr; + } PopTag(); mOutput << startstr << "" << endstr; - mOutput << startstr << "" << date_str << "" << endstr; + + if (!meta || !meta->Get("Created", value)) + mOutput << startstr << "" << date_str << "" << endstr; + else + mOutput << startstr << "" << XMLEscape(value.C_Str()) << "" << endstr; + + // Modified date is always the date saved mOutput << startstr << "" << date_str << "" << endstr; + + if (meta) + { + if (meta->Get("Keywords", value)) + mOutput << startstr << "" << XMLEscape(value.C_Str()) << "" << endstr; + if (meta->Get("Revision", value)) + mOutput << startstr << "" << XMLEscape(value.C_Str()) << "" << endstr; + if (meta->Get("Subject", value)) + mOutput << startstr << "" << XMLEscape(value.C_Str()) << "" << endstr; + if (meta->Get("Title", value)) + mOutput << startstr << "" << XMLEscape(value.C_Str()) << "" << endstr; + } + mOutput << startstr << "" << endstr; mOutput << startstr << "" << up_axis << "" << endstr; PopTag(); diff --git a/code/ColladaLoader.cpp b/code/ColladaLoader.cpp index 47a40f5d9..cf548e890 100644 --- a/code/ColladaLoader.cpp +++ b/code/ColladaLoader.cpp @@ -208,9 +208,14 @@ void ColladaLoader::InternReadFile( const std::string& pFile, aiScene* pScene, I } // Store scene metadata - for (auto it = parser.mAssetMetaData.cbegin(); it != parser.mAssetMetaData.cend(); ++it) - { - pScene->mMetaData->Add((*it).first, (*it).second); + if (!parser.mAssetMetaData.empty()) { + const size_t numMeta(parser.mAssetMetaData.size()); + pScene->mMetaData = aiMetadata::Alloc(static_cast(numMeta)); + size_t i = 0; + for (auto it = parser.mAssetMetaData.cbegin(); it != parser.mAssetMetaData.cend(); ++it, ++i) + { + pScene->mMetaData->Set(static_cast(i), (*it).first, (*it).second); + } } // store all meshes diff --git a/code/ColladaParser.cpp b/code/ColladaParser.cpp index c38d18283..2106bf01c 100644 --- a/code/ColladaParser.cpp +++ b/code/ColladaParser.cpp @@ -267,24 +267,16 @@ void ColladaParser::ReadAssetInfo() } else if(IsElement("contributor")) { - // This has no data of its own, will get children next time through + ReadContributorInfo(); } else { - const char* metadata_key = mReader->getNodeName(); - const char* metadata_value = TestTextContent(); - if (metadata_key != nullptr && metadata_value != nullptr) - { - aiString aistr; - aistr.Set(metadata_value); - mAssetMetaData.emplace(metadata_key, aistr); - } - //SkipElement(); + ReadMetaDataItem(mAssetMetaData); } } else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { - if( strcmp( mReader->getNodeName(), "asset") != 0) + if (strcmp( mReader->getNodeName(), "asset") != 0) ThrowException( "Expected end of element."); break; @@ -292,6 +284,75 @@ void ColladaParser::ReadAssetInfo() } } +// ------------------------------------------------------------------------------------------------ +// Reads the contributor info +void ColladaParser::ReadContributorInfo() +{ + if (mReader->isEmptyElement()) + return; + + while (mReader->read()) + { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) + { + ReadMetaDataItem(mAssetMetaData); + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) + { + if (strcmp(mReader->getNodeName(), "contributor") != 0) + ThrowException("Expected end of element."); + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads a single string metadata item +void ColladaParser::ReadMetaDataItem(StringMetaData &metadata) +{ + // Metadata such as created, keywords, subject etc + const char* key_char = mReader->getNodeName(); + if (key_char != nullptr) + { + const std::string key_str(key_char); + const char* value_char = TestTextContent(); + if (value_char != nullptr) + { + std::string camel_key_str = key_str; + ToCamelCase(camel_key_str); + aiString aistr; + aistr.Set(value_char); + metadata.emplace(camel_key_str, aistr); + TestClosing(key_str.c_str()); + } + else + SkipElement(); + } + else + SkipElement(); +} + +// ------------------------------------------------------------------------------------------------ +// Convert underscore_seperated to CamelCase: "authoring_tool" becomes "AuthoringTool" +void ColladaParser::ToCamelCase(std::string &text) +{ + if (text.empty()) + return; + // Capitalise first character + text[0] = ToUpper(text[0]); + for (auto it = text.begin(); it != text.end(); /*iterated below*/) + { + if ((*it) == '_') + { + it = text.erase(it); + if (it != text.end()) + (*it) = ToUpper(*it); + } + else + ++it; + } +} + // ------------------------------------------------------------------------------------------------ // Reads the animation clips void ColladaParser::ReadAnimationClipLibrary() diff --git a/code/ColladaParser.h b/code/ColladaParser.h index 9fdca86c8..22b96c5e0 100644 --- a/code/ColladaParser.h +++ b/code/ColladaParser.h @@ -66,6 +66,9 @@ namespace Assimp friend class ColladaLoader; protected: + /** Map for generic metadata as aiString */ + typedef std::map StringMetaData; + /** Constructor from XML file */ ColladaParser( IOSystem* pIOHandler, const std::string& pFile); @@ -81,6 +84,15 @@ namespace Assimp /** Reads asset information such as coordinate system information and legal blah */ void ReadAssetInfo(); + /** Reads contributor information such as author and legal blah */ + void ReadContributorInfo(); + + /** Reads generic metadata into provided map */ + void ReadMetaDataItem(StringMetaData &metadata); + + /** Convert underscore_seperated to CamelCase "authoring_tool" becomes "AuthoringTool" */ + static void ToCamelCase(std::string &text); + /** Reads the animation library */ void ReadAnimationLibrary(); @@ -343,8 +355,8 @@ namespace Assimp /** Which is the up vector */ enum { UP_X, UP_Y, UP_Z } mUpDirection; - typedef std::map AssetMetaData; - AssetMetaData mAssetMetaData; + /** Asset metadata (global for scene) */ + StringMetaData mAssetMetaData; /** Collada file format version */ Collada::FormatVersion mFormat; From 9aae110161a0100e9a8a00a65bf681d7b2d1832c Mon Sep 17 00:00:00 2001 From: Charlie Gettys Date: Wed, 10 Apr 2019 09:29:21 -0400 Subject: [PATCH 07/34] * Remove old non-maintained mingw makefile to prevent confusion * Add notes on building with MinGW to Build.md --- Build.md | 13 +++++- code/makefile.mingw | 105 -------------------------------------------- 2 files changed, 12 insertions(+), 106 deletions(-) delete mode 100644 code/makefile.mingw diff --git a/Build.md b/Build.md index d5b443a79..04bec04f0 100644 --- a/Build.md +++ b/Build.md @@ -23,7 +23,7 @@ This will generate the project files for the visual studio. All dependencies use See https://stackoverflow.com/questions/40803170/cmake-uwp-using-cmake-to-build-universal-windows-app -# Build instrcutions for Linux / Unix +# Build instructions for Linux / Unix Open a terminal and got to your repository. You can generate the makefiles and build the library via: ``` @@ -34,6 +34,17 @@ The option -j descripes the number of parallel processes for the build. In this If you want to use a IDE for linux you can try QTCreator for instance. +# Build instructions for MinGW + +Please see [CMake Cross Compiling](https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling) for general information on CMake Toolchains. + +Some users have had success building assimp using MinGW on Linux using the following toolchain, which is not maintained by assimp. [linux-mingw-w64-gnuxx11.cmake](https://github.com/ruslo/polly/blob/master/linux-mingw-w64-gnuxx11.cmake) + +The following toolchain may or may not be helpful for building assimp using MinGW on Windows (untested): + [mingw-cxx17.cmake](https://github.com/ruslo/polly/blob/master/mingw-cxx17.cmake) + +Besides the toolchain, compilation should be the same as for Linux / Unix + # CMake build options The cmake-build-environment provides options to configure the build. The following options can be used: - **BUILD_SHARED_LIBS ( default ON )**: Generation of shared libs ( dll for windows, so for Linux ). Set this to OFF to get a static lib. diff --git a/code/makefile.mingw b/code/makefile.mingw deleted file mode 100644 index 711d57f57..000000000 --- a/code/makefile.mingw +++ /dev/null @@ -1,105 +0,0 @@ -### USE OF THIS MAKEFILE IS NOT RECOMMENDED. -### It is no longer maintained. Use CMAKE instead. - -# --------------------------------------------------------------------------- -# Makefile for Open Asset Import Library (MinGW32-make) -# aramis_acg@users.sourceforge.net -# - just a quick'n'dirty one, could be buggy ... -# -# Usage: mingw32-make -f makefile.mingw - -# TARGETS: -# all Build a shared so from the whole library -# clean Cleanup object files, prepare for rebuild -# static Build a static library (*.a) - -# MACROS: (make clean before you change one) -# NOBOOST=1 Build against boost workaround -# SINGLETHREADED=1 Build single-threaded library -# DEBUG=1 Build debug build of library -# -# --------------------------------------------------------------------------- - -# C++ object files -OBJECTS := $(patsubst %.cpp,%.o, $(wildcard *.cpp)) -OBJECTS += $(patsubst %.cpp,%.o, $(wildcard extra/*.cpp)) -OBJECTS += $(patsubst %.cpp,%.o, $(wildcard ./../contrib/irrXML/*.cpp)) - -# C object files -OBJECTSC := $(patsubst %.c,%.oc, $(wildcard ./../contrib/zlib/*.c)) -OBJECTSC += $(patsubst %.c,%.oc, $(wildcard ./../contrib/ConvertUTF/*.c)) -OBJECTSC += $(patsubst %.c,%.oc, $(wildcard ./../contrib/unzip/*.c)) - -# Include flags for gcc -INCLUDEFLAGS = - -# Preprocessor defines for gcc -DEFINEFLAGS = - -# Suffix for the output binary, represents build type -NAMESUFFIX = - -# Output path for binaries -BINPATH = ../bin/mingw/ - -# GCC compiler flags -CPPFLAGS=-Wall - -# Setup environment for noboost build -ifeq ($(NOBOOST),1) - SINGLETHREADED = 1 - INCLUDEFLAGS += -I./BoostWorkaround/ - DEFINEFLAGS += -DASSIMP_BUILD_BOOST_WORKAROUND -# NAMESUFFIX += -noboost -else - # adjust this manually if your boost is stored elsewhere - INCLUDEFLAGS += -I"C:/Program Files/boost/boost_1_38" - #INCLUDEFLAGS += -I"$(BOOST_DIR)" - -endif - -# Setup environment for st build -ifeq ($(SINGLETHREADED),1) - DEFINEFLAGS += -DASSIMP_BUILD_SINGLETHREADED -# NAMESUFFIX += -st -endif - -# Setup environment for debug build -ifeq ($(DEBUG),1) - DEFINEFLAGS += -D_DEBUG -DDEBUG - CPPFLAGS += -g -# NAMESUFFIX += -debug -else - CPPFLAGS += -O2 -s - DEFINEFLAGS += -DNDEBUG -D_NDEBUG -endif - -# Output name of shared library -SHARED_TARGET = $(BINPATH)/libassimp$(NAMESUFFIX).so - -# Output name of static library -STATIC = $(BINPATH)/libassimp$(NAMESUFFIX).a - -# target: all -# usage : build a shared library (*.so) -all: $(SHARED_TARGET) - -$(SHARED_TARGET): $(OBJECTS) $(OBJECTSC) - gcc -o $@ $(OBJECTS) $(OBJECTSC) -shared -lstdc++ -%.o:%.cpp - $(CXX) -c $(CPPFLAGS) $? -o $@ $(INCLUDEFLAGS) $(DEFINEFLAGS) -%.oc:%.c - $(CXX) -x c -c -ansi $(CPPFLAGS) $? -o $@ - -# target: clean -# usage : cleanup all object files, prepare for a rebuild -.PHONY: clean -clean: - -del *.o .\..\contrib\irrXML\*.o .\..\contrib\zlib\*.oc .\..\contrib\unzip\*.oc .\..\contrib\ConvertUTF\*.oc - -# target: static -# usage : build a static library (*.a) -static: $(STATIC) -$(STATIC): $(OBJECTS) $(OBJECTSC) - ar rcs $@ $(OBJECTS) $(OBJECTSC) - From f7384dec95832c6e91f5b7896749a195c8daab52 Mon Sep 17 00:00:00 2001 From: Charlie Gettys Date: Wed, 10 Apr 2019 09:45:31 -0400 Subject: [PATCH 08/34] Possible fix for #2406. Shouldn't affect other compiled files, but have not verified this. Also, if anyone tries to debug StepFileGen1.cpp on MinGW, the debug info may not be there, but I think this is the best we can do. --- code/CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index a265a01dc..be70ba88c 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -800,6 +800,18 @@ ADD_ASSIMP_IMPORTER( MMD MMDVmdParser.h ) +# Workaround for issue #2406 - force problematic large file to be optimized to prevent string table overflow error +# Used -Os instead of -O2 as previous issues had mentioned, since -Os is roughly speaking -O2, excluding any +# optimizations that take up extra space. Given that the issue is a string table overflowing, -Os seemed appropriate +# Also, I'm not positive if both link & compile flags are needed, but this hopefully ensures that the issue should not +# recur for edge cases such as static builds. +if ((CMAKE_COMPILER_IS_MINGW) AND (CMAKE_BUILD_TYPE MATCHES Debug)) + message("-- Applying MinGW StepFileGen1.cpp Debug Workaround") + SET_SOURCE_FILES_PROPERTIES(Importer/StepFile/StepFileGen1.cpp PROPERTIES COMPILE_FLAGS -Os ) + SET_SOURCE_FILES_PROPERTIES(Importer/StepFile/StepFileGen1.cpp PROPERTIES LINK_FLAGS -Os ) + SET_SOURCE_FILES_PROPERTIES(Importer/StepFile/StepFileGen1.cpp PROPERTIES STATIC_LIBRARY_FLAGS -Os ) +endif() + ADD_ASSIMP_IMPORTER( STEP STEPFile.h Importer/StepFile/StepFileImporter.h From 6a373d55c7c78cf8aabc2c829abc62d9b9a5d47f Mon Sep 17 00:00:00 2001 From: Charlie Gettys Date: Wed, 10 Apr 2019 10:07:24 -0400 Subject: [PATCH 09/34] * Add notes on MinGW compiler version requirements * Add check on MinGW compiler version to force compliance. * Closes #2315 ? --- Build.md | 5 ++++- CMakeLists.txt | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Build.md b/Build.md index 04bec04f0..2e47c8cab 100644 --- a/Build.md +++ b/Build.md @@ -35,6 +35,9 @@ The option -j descripes the number of parallel processes for the build. In this If you want to use a IDE for linux you can try QTCreator for instance. # Build instructions for MinGW + Older versions of MinGW's compiler (e.g. 5.1.0) do not support the -mbig_obj flag +required to compile some of assimp's files, especially for debug builds. +Version 7.3.0 of g++-mingw-w64 & gcc-mingw-w64 appears to work. Please see [CMake Cross Compiling](https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling) for general information on CMake Toolchains. @@ -43,7 +46,7 @@ Some users have had success building assimp using MinGW on Linux using the follo The following toolchain may or may not be helpful for building assimp using MinGW on Windows (untested): [mingw-cxx17.cmake](https://github.com/ruslo/polly/blob/master/mingw-cxx17.cmake) -Besides the toolchain, compilation should be the same as for Linux / Unix +Besides the toolchain, compilation should be the same as for Linux / Unix. # CMake build options The cmake-build-environment provides options to configure the build. The following options can be used: diff --git a/CMakeLists.txt b/CMakeLists.txt index 13a054de2..755bef89a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -234,7 +234,12 @@ ELSEIF ( "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" ) SET(CMAKE_CXX_FLAGS "-g -fvisibility=hidden -fPIC -fno-strict-aliasing -Wall -Wno-long-long -std=c++11 ${CMAKE_CXX_FLAGS}" ) SET(CMAKE_C_FLAGS "-fPIC -fno-strict-aliasing ${CMAKE_C_FLAGS}") ELSEIF( CMAKE_COMPILER_IS_MINGW ) - SET( CMAKE_CXX_FLAGS "-fvisibility=hidden -fno-strict-aliasing -Wall -Wno-long-long -std=c++11 -Wa,-mbig-obj ${CMAKE_CXX_FLAGS}" ) + IF (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0) + message(FATAL_ERROR "MinGW is too old") + ELSEIF(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.3) + message(WARNING "MinGW is old, if you experience errors, update MinGW") + ENDIF() + SET( CMAKE_CXX_FLAGS "-fvisibility=hidden -fPIC -fno-strict-aliasing -Wall -Wno-long-long -std=c++11 -Wa,-mbig-obj ${CMAKE_CXX_FLAGS}" ) SET(CMAKE_C_FLAGS "-fPIC -fno-strict-aliasing ${CMAKE_C_FLAGS} ") ADD_DEFINITIONS( -U__STRICT_ANSI__ ) ENDIF() From 567a645c4fa3fdad65c1004ac92e62384ff7bff5 Mon Sep 17 00:00:00 2001 From: Charlie Gettys Date: Wed, 10 Apr 2019 10:31:57 -0400 Subject: [PATCH 10/34] * Improve error message for new check on MinGW compiler version --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 755bef89a..2250e8006 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -235,11 +235,11 @@ ELSEIF ( "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" ) SET(CMAKE_C_FLAGS "-fPIC -fno-strict-aliasing ${CMAKE_C_FLAGS}") ELSEIF( CMAKE_COMPILER_IS_MINGW ) IF (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0) - message(FATAL_ERROR "MinGW is too old") + message(FATAL_ERROR "MinGW is too old to be supported. Please update MinGW and try again.") ELSEIF(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.3) - message(WARNING "MinGW is old, if you experience errors, update MinGW") + message(WARNING "MinGW is old, if you experience errors, update MinGW.") ENDIF() - SET( CMAKE_CXX_FLAGS "-fvisibility=hidden -fPIC -fno-strict-aliasing -Wall -Wno-long-long -std=c++11 -Wa,-mbig-obj ${CMAKE_CXX_FLAGS}" ) + SET( CMAKE_CXX_FLAGS "-fvisibility=hidden -fno-strict-aliasing -Wall -Wno-long-long -std=c++11 -Wa,-mbig-obj ${CMAKE_CXX_FLAGS}" ) SET(CMAKE_C_FLAGS "-fPIC -fno-strict-aliasing ${CMAKE_C_FLAGS} ") ADD_DEFINITIONS( -U__STRICT_ANSI__ ) ENDIF() From 24a0aaeb779d0b30e4e1640afebab8159e596d6c Mon Sep 17 00:00:00 2001 From: Charlie Gettys Date: Wed, 10 Apr 2019 11:02:36 -0400 Subject: [PATCH 11/34] Fix Codacy Warning --- Build.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Build.md b/Build.md index 2e47c8cab..afee8caf7 100644 --- a/Build.md +++ b/Build.md @@ -1,16 +1,17 @@ -# Install CMake +# Build Instructions +## Install CMake Asset-Importer-Lib can be build for a lot of different platforms. We are using cmake to generate the build environment for these via cmake. So you have to make sure that you have a working cmake-installation on your system. You can download it at https://cmake.org/ or for linux install it via ``` sudo apt-get install cmake ``` -# Get the source +## Get the source Make sure you have a working git-installation. Open a command prompt and clone the Asset-Importer-Lib via: ``` git clone https://github.com/assimp/assimp.git ``` -# Build instructions for Windows with Visual-Studio +## Build instructions for Windows with Visual-Studio First you have to install Visual-Studio on your windows-system. You can get the Community-Version for free here: https://visualstudio.microsoft.com/de/downloads/ To generate the build environment for your IDE open a command prompt, navigate to your repo and type: @@ -19,11 +20,11 @@ To generate the build environment for your IDE open a command prompt, navigate t ``` This will generate the project files for the visual studio. All dependencies used to build Asset-IMporter-Lib shall be part of the repo. If you want to use you own zlib.installation this is possible as well. Check the options for it. -# Build instructions for Windows with UWP +## Build instructions for Windows with UWP See https://stackoverflow.com/questions/40803170/cmake-uwp-using-cmake-to-build-universal-windows-app -# Build instructions for Linux / Unix +## Build instructions for Linux / Unix Open a terminal and got to your repository. You can generate the makefiles and build the library via: ``` @@ -34,7 +35,7 @@ The option -j descripes the number of parallel processes for the build. In this If you want to use a IDE for linux you can try QTCreator for instance. -# Build instructions for MinGW +## Build instructions for MinGW Older versions of MinGW's compiler (e.g. 5.1.0) do not support the -mbig_obj flag required to compile some of assimp's files, especially for debug builds. Version 7.3.0 of g++-mingw-w64 & gcc-mingw-w64 appears to work. @@ -48,7 +49,7 @@ The following toolchain may or may not be helpful for building assimp using MinG Besides the toolchain, compilation should be the same as for Linux / Unix. -# CMake build options +## CMake build options The cmake-build-environment provides options to configure the build. The following options can be used: - **BUILD_SHARED_LIBS ( default ON )**: Generation of shared libs ( dll for windows, so for Linux ). Set this to OFF to get a static lib. - **BUILD_FRAMEWORK ( default OFF, MacOnly)**: Build package as Mac OS X Framework bundle From c1f3624f5b18f7207a6dff5674bbf1c3e7c70c13 Mon Sep 17 00:00:00 2001 From: Charlie Gettys Date: Wed, 10 Apr 2019 11:06:00 -0400 Subject: [PATCH 12/34] Fix more codacy warnings --- Build.md | 49 ++++++++++++++++++++++++------------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/Build.md b/Build.md index afee8caf7..dc81fe0d7 100644 --- a/Build.md +++ b/Build.md @@ -1,13 +1,13 @@ # Build Instructions ## Install CMake Asset-Importer-Lib can be build for a lot of different platforms. We are using cmake to generate the build environment for these via cmake. So you have to make sure that you have a working cmake-installation on your system. You can download it at https://cmake.org/ or for linux install it via -``` +```bash sudo apt-get install cmake ``` ## Get the source Make sure you have a working git-installation. Open a command prompt and clone the Asset-Importer-Lib via: -``` +```bash git clone https://github.com/assimp/assimp.git ``` @@ -15,19 +15,18 @@ git clone https://github.com/assimp/assimp.git First you have to install Visual-Studio on your windows-system. You can get the Community-Version for free here: https://visualstudio.microsoft.com/de/downloads/ To generate the build environment for your IDE open a command prompt, navigate to your repo and type: -``` -> cmake CMakeLists.txt +```bash +cmake CMakeLists.txt ``` This will generate the project files for the visual studio. All dependencies used to build Asset-IMporter-Lib shall be part of the repo. If you want to use you own zlib.installation this is possible as well. Check the options for it. ## Build instructions for Windows with UWP See https://stackoverflow.com/questions/40803170/cmake-uwp-using-cmake-to-build-universal-windows-app - ## Build instructions for Linux / Unix Open a terminal and got to your repository. You can generate the makefiles and build the library via: -``` +```bash cmake CMakeLists.txt make -j4 ``` @@ -51,23 +50,23 @@ Besides the toolchain, compilation should be the same as for Linux / Unix. ## CMake build options The cmake-build-environment provides options to configure the build. The following options can be used: -- **BUILD_SHARED_LIBS ( default ON )**: Generation of shared libs ( dll for windows, so for Linux ). Set this to OFF to get a static lib. -- **BUILD_FRAMEWORK ( default OFF, MacOnly)**: Build package as Mac OS X Framework bundle -- **ASSIMP_DOUBLE_PRECISION( default OFF )**: All data will be stored as double values. -- **ASSIMP_OPT_BUILD_PACKAGES ( default OFF)**: Set to ON to generate CPack configuration files and packaging targets -- **ASSIMP_ANDROID_JNIIOSYSTEM ( default OFF )**: Android JNI IOSystem support is active -- **ASSIMP_NO_EXPORT ( default OFF )**: Disable Assimp's export functionality -- **ASSIMP_BUILD_ZLIB ( default OFF )**: Build your own zlib -- **ASSIMP_BUILD_ASSIMP_TOOLS ( default ON )**: If the supplementary tools for Assimp are built in addition to the library. -- **ASSIMP_BUILD_SAMPLES ( default OFF )**: If the official samples are built as well (needs Glut). -- **ASSIMP_BUILD_TESTS ( default ON )**: If the test suite for Assimp is built in addition to the library. -- **ASSIMP_COVERALLS ( default OFF )**: Enable this to measure test coverage. -- **ASSIMP_WERROR( default OFF )**: Treat warnings as errors. -- **ASSIMP_ASAN ( default OFF )**: Enable AddressSanitizer. -- **ASSIMP_UBSAN ( default OFF )**: Enable Undefined Behavior sanitizer. -- **SYSTEM_IRRXML ( default OFF )**: Use system installed Irrlicht/IrrXML library. -- **BUILD_DOCS ( default OFF )**: Build documentation using Doxygen. -- **INJECT_DEBUG_POSTFIX( default ON )**: Inject debug postfix in .a/.so lib names -- **IGNORE_GIT_HASH ( default OFF )**: Don't call git to get the hash. -- **ASSIMP_INSTALL_PDB ( default ON )**: Install MSVC debug files. + - **BUILD_SHARED_LIBS ( default ON )**: Generation of shared libs ( dll for windows, so for Linux ). Set this to OFF to get a static lib. + - **BUILD_FRAMEWORK ( default OFF, MacOnly)**: Build package as Mac OS X Framework bundle + - **ASSIMP_DOUBLE_PRECISION( default OFF )**: All data will be stored as double values. + - **ASSIMP_OPT_BUILD_PACKAGES ( default OFF)**: Set to ON to generate CPack configuration files and packaging targets + - **ASSIMP_ANDROID_JNIIOSYSTEM ( default OFF )**: Android JNI IOSystem support is active + - **ASSIMP_NO_EXPORT ( default OFF )**: Disable Assimp's export functionality + - **ASSIMP_BUILD_ZLIB ( default OFF )**: Build your own zlib + - **ASSIMP_BUILD_ASSIMP_TOOLS ( default ON )**: If the supplementary tools for Assimp are built in addition to the library. + - **ASSIMP_BUILD_SAMPLES ( default OFF )**: If the official samples are built as well (needs Glut). + - **ASSIMP_BUILD_TESTS ( default ON )**: If the test suite for Assimp is built in addition to the library. + - **ASSIMP_COVERALLS ( default OFF )**: Enable this to measure test coverage. + - **ASSIMP_WERROR( default OFF )**: Treat warnings as errors. + - **ASSIMP_ASAN ( default OFF )**: Enable AddressSanitizer. + - **ASSIMP_UBSAN ( default OFF )**: Enable Undefined Behavior sanitizer. + - **SYSTEM_IRRXML ( default OFF )**: Use system installed Irrlicht/IrrXML library. + - **BUILD_DOCS ( default OFF )**: Build documentation using Doxygen. + - **INJECT_DEBUG_POSTFIX( default ON )**: Inject debug postfix in .a/.so lib names + - **IGNORE_GIT_HASH ( default OFF )**: Don't call git to get the hash. + - **ASSIMP_INSTALL_PDB ( default ON )**: Install MSVC debug files. From 1b0c1139ebe306beaa55f3f5911d707b0d578a6f Mon Sep 17 00:00:00 2001 From: Charlie Gettys Date: Wed, 10 Apr 2019 11:45:30 -0400 Subject: [PATCH 13/34] Fix more codacy warnings! --- Build.md | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/Build.md b/Build.md index dc81fe0d7..1e28c648f 100644 --- a/Build.md +++ b/Build.md @@ -21,7 +21,7 @@ cmake CMakeLists.txt This will generate the project files for the visual studio. All dependencies used to build Asset-IMporter-Lib shall be part of the repo. If you want to use you own zlib.installation this is possible as well. Check the options for it. ## Build instructions for Windows with UWP -See https://stackoverflow.com/questions/40803170/cmake-uwp-using-cmake-to-build-universal-windows-app +See ## Build instructions for Linux / Unix Open a terminal and got to your repository. You can generate the makefiles and build the library via: @@ -50,23 +50,22 @@ Besides the toolchain, compilation should be the same as for Linux / Unix. ## CMake build options The cmake-build-environment provides options to configure the build. The following options can be used: - - **BUILD_SHARED_LIBS ( default ON )**: Generation of shared libs ( dll for windows, so for Linux ). Set this to OFF to get a static lib. - - **BUILD_FRAMEWORK ( default OFF, MacOnly)**: Build package as Mac OS X Framework bundle - - **ASSIMP_DOUBLE_PRECISION( default OFF )**: All data will be stored as double values. - - **ASSIMP_OPT_BUILD_PACKAGES ( default OFF)**: Set to ON to generate CPack configuration files and packaging targets - - **ASSIMP_ANDROID_JNIIOSYSTEM ( default OFF )**: Android JNI IOSystem support is active - - **ASSIMP_NO_EXPORT ( default OFF )**: Disable Assimp's export functionality - - **ASSIMP_BUILD_ZLIB ( default OFF )**: Build your own zlib - - **ASSIMP_BUILD_ASSIMP_TOOLS ( default ON )**: If the supplementary tools for Assimp are built in addition to the library. - - **ASSIMP_BUILD_SAMPLES ( default OFF )**: If the official samples are built as well (needs Glut). - - **ASSIMP_BUILD_TESTS ( default ON )**: If the test suite for Assimp is built in addition to the library. - - **ASSIMP_COVERALLS ( default OFF )**: Enable this to measure test coverage. - - **ASSIMP_WERROR( default OFF )**: Treat warnings as errors. - - **ASSIMP_ASAN ( default OFF )**: Enable AddressSanitizer. - - **ASSIMP_UBSAN ( default OFF )**: Enable Undefined Behavior sanitizer. - - **SYSTEM_IRRXML ( default OFF )**: Use system installed Irrlicht/IrrXML library. - - **BUILD_DOCS ( default OFF )**: Build documentation using Doxygen. - - **INJECT_DEBUG_POSTFIX( default ON )**: Inject debug postfix in .a/.so lib names - - **IGNORE_GIT_HASH ( default OFF )**: Don't call git to get the hash. - - **ASSIMP_INSTALL_PDB ( default ON )**: Install MSVC debug files. - +- **BUILD_SHARED_LIBS ( default ON )**: Generation of shared libs ( dll for windows, so for Linux ). Set this to OFF to get a static lib. +- **BUILD_FRAMEWORK ( default OFF, MacOnly)**: Build package as Mac OS X Framework bundle +- **ASSIMP_DOUBLE_PRECISION( default OFF )**: All data will be stored as double values. +- **ASSIMP_OPT_BUILD_PACKAGES ( default OFF)**: Set to ON to generate CPack configuration files and packaging targets +- **ASSIMP_ANDROID_JNIIOSYSTEM ( default OFF )**: Android JNI IOSystem support is active +- **ASSIMP_NO_EXPORT ( default OFF )**: Disable Assimp's export functionality +- **ASSIMP_BUILD_ZLIB ( default OFF )**: Build your own zlib +- **ASSIMP_BUILD_ASSIMP_TOOLS ( default ON )**: If the supplementary tools for Assimp are built in addition to the library. +- **ASSIMP_BUILD_SAMPLES ( default OFF )**: If the official samples are built as well (needs Glut). +- **ASSIMP_BUILD_TESTS ( default ON )**: If the test suite for Assimp is built in addition to the library. +- **ASSIMP_COVERALLS ( default OFF )**: Enable this to measure test coverage. +- **ASSIMP_WERROR( default OFF )**: Treat warnings as errors. +- **ASSIMP_ASAN ( default OFF )**: Enable AddressSanitizer. +- **ASSIMP_UBSAN ( default OFF )**: Enable Undefined Behavior sanitizer. +- **SYSTEM_IRRXML ( default OFF )**: Use system installed Irrlicht/IrrXML library. +- **BUILD_DOCS ( default OFF )**: Build documentation using Doxygen. +- **INJECT_DEBUG_POSTFIX( default ON )**: Inject debug postfix in .a/.so lib names +- **IGNORE_GIT_HASH ( default OFF )**: Don't call git to get the hash. +- **ASSIMP_INSTALL_PDB ( default ON )**: Install MSVC debug files. From 2f6f71651226874ac57538ff8e772d0821dead28 Mon Sep 17 00:00:00 2001 From: Charlie Gettys Date: Wed, 10 Apr 2019 12:42:19 -0400 Subject: [PATCH 14/34] Clarify build instructions --- Build.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Build.md b/Build.md index 1e28c648f..7c908606d 100644 --- a/Build.md +++ b/Build.md @@ -41,7 +41,9 @@ Version 7.3.0 of g++-mingw-w64 & gcc-mingw-w64 appears to work. Please see [CMake Cross Compiling](https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling) for general information on CMake Toolchains. -Some users have had success building assimp using MinGW on Linux using the following toolchain, which is not maintained by assimp. [linux-mingw-w64-gnuxx11.cmake](https://github.com/ruslo/polly/blob/master/linux-mingw-w64-gnuxx11.cmake) +Some users have had success building assimp using MinGW on Linux using [polly](https://github.com/ruslo/polly/). + +The following toolchain, which is not maintained by assimp, seems to work on Linux: [linux-mingw-w64-gnuxx11.cmake](https://github.com/ruslo/polly/blob/master/linux-mingw-w64-gnuxx11.cmake) The following toolchain may or may not be helpful for building assimp using MinGW on Windows (untested): [mingw-cxx17.cmake](https://github.com/ruslo/polly/blob/master/mingw-cxx17.cmake) From 9b9b2c83393624e6a152556e6d35cd3169e12934 Mon Sep 17 00:00:00 2001 From: Simon Puente Date: Sun, 14 Apr 2019 10:13:32 -0700 Subject: [PATCH 15/34] Fix typo on README.md changing "fascade" to "facade" --- port/AndroidJNI/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/port/AndroidJNI/README.md b/port/AndroidJNI/README.md index 7998fa3ef..0b95efd04 100644 --- a/port/AndroidJNI/README.md +++ b/port/AndroidJNI/README.md @@ -1,6 +1,6 @@ Build Asset Importer Lib for Android ==================================== -This module provides a fascade for the io-stream-access to files behind the android-asset-management within +This module provides a facade for the io-stream-access to files behind the android-asset-management within an Android-native application. - It is built as a static library - It requires Android NDK with android API > 9 support. From 836801d37e6ce91bea8cb436c41e55b7b47a817b Mon Sep 17 00:00:00 2001 From: RichardTea <31507749+RichardTea@users.noreply.github.com> Date: Wed, 17 Apr 2019 09:32:24 +0100 Subject: [PATCH 16/34] CMake updates for VS2015/cmake 3.12 onwards cmake 3.12 adds MSVC_TOOLSET_VERSION to define the version of MSVC toolchain in use Use that if present instead of if-elseif chain --- CMakeLists.txt | 29 +++++++++++++++++------------ code/CMakeLists.txt | 7 +++++++ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb7a3d967..56b6e3c4f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,7 +106,7 @@ OPTION ( BUILD_DOCS OFF ) OPTION( INJECT_DEBUG_POSTFIX - "Inject debug postfix in .a/.so lib names" + "Inject debug postfix in .a/.so/.dll lib names" ON ) @@ -127,14 +127,15 @@ if (WIN32) ADD_DEFINITIONS( -DWIN32_LEAN_AND_MEAN ) endif() - IF(MSVC) OPTION( ASSIMP_INSTALL_PDB "Install MSVC debug files." ON ) - # Multibyte character set is deprecated, but default - ADD_DEFINITIONS( -DUNICODE -D_UNICODE ) + IF(NOT (MSVC_VERSION LESS 1900)) + # Multibyte character set is deprecated since at least MSVC2015 (possibly earlier) + ADD_DEFINITIONS( -DUNICODE -D_UNICODE ) + ENDIF() ENDIF(MSVC) IF (BUILD_FRAMEWORK) @@ -545,18 +546,22 @@ if(WIN32) if (CMAKE_SIZEOF_VOID_P EQUAL 8) SET(BIN_DIR "${PROJECT_SOURCE_DIR}/bin64/") SET(LIB_DIR "${PROJECT_SOURCE_DIR}/lib64/") - elseif() + else() SET(BIN_DIR "${PROJECT_SOURCE_DIR}/bin32/") SET(LIB_DIR "${PROJECT_SOURCE_DIR}/lib32/") ENDIF() - IF(MSVC12) - SET(ASSIMP_MSVC_VERSION "vc120") - ELSEIF(MSVC14) - SET(ASSIMP_MSVC_VERSION "vc140") - ELSEIF(MSVC15) - SET(ASSIMP_MSVC_VERSION "vc141") - ENDIF(MSVC12) + IF(MSVC_TOOLSET_VERSION) + set(MSVC_PREFIX "vc${MSVC_TOOLSET_VERSION}") + ELSE() + IF(MSVC12) + SET(ASSIMP_MSVC_VERSION "vc120") + ELSEIF(MSVC14) + SET(ASSIMP_MSVC_VERSION "vc140") + ELSEIF(MSVC15) + SET(ASSIMP_MSVC_VERSION "vc141") + ENDIF(MSVC12) + ENDIF() IF(MSVC12 OR MSVC14 OR MSVC15 ) ADD_CUSTOM_TARGET(UpdateAssimpLibsDebugSymbolsAndDLLs COMMENT "Copying Assimp Libraries ..." VERBATIM) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index e310e6423..05f916abd 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -1037,6 +1037,10 @@ ENDIF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER) if( MSVC ) # in order to prevent DLL hell, each of the DLLs have to be suffixed with the major version and msvc prefix + # CMake 3.12 added a variable for this + if(MSVC_TOOLSET_VERSION) + set(MSVC_PREFIX "vc${MSVC_TOOLSET_VERSION}") + else() if( MSVC70 OR MSVC71 ) set(MSVC_PREFIX "vc70") elseif( MSVC80 ) @@ -1051,9 +1055,12 @@ if( MSVC ) set(MSVC_PREFIX "vc120") elseif( MSVC14 ) set(MSVC_PREFIX "vc140") + elseif( MSVC15 ) + set(MSVC_PREFIX "vc141") else() set(MSVC_PREFIX "vc150") endif() + endif() set(LIBRARY_SUFFIX "${ASSIMP_LIBRARY_SUFFIX}-${MSVC_PREFIX}-mt" CACHE STRING "the suffix for the assimp windows library") endif() From 9242a12bf5e69974b00fee257ed3f219b8c6df06 Mon Sep 17 00:00:00 2001 From: RichardTea <31507749+RichardTea@users.noreply.github.com> Date: Wed, 17 Apr 2019 09:32:59 +0100 Subject: [PATCH 17/34] Qt5 requires cmake 3.1 Earlier versions are not supported --- tools/assimp_qt_viewer/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/assimp_qt_viewer/CMakeLists.txt b/tools/assimp_qt_viewer/CMakeLists.txt index cd15372b5..d8d8e27a9 100644 --- a/tools/assimp_qt_viewer/CMakeLists.txt +++ b/tools/assimp_qt_viewer/CMakeLists.txt @@ -1,7 +1,8 @@ set(PROJECT_VERSION "") project(assimp_qt_viewer) -cmake_minimum_required(VERSION 3.0) +# Qt5 requires cmake 3.1 or newer +cmake_minimum_required(VERSION 3.1) FIND_PACKAGE(OpenGL QUIET) From 692927a8a1bd123402ee04ab1ec917d160b3be2d Mon Sep 17 00:00:00 2001 From: RichardTea <31507749+RichardTea@users.noreply.github.com> Date: Wed, 17 Apr 2019 10:03:18 +0100 Subject: [PATCH 18/34] Default CMAKE_DEBUG_POSTFIX to 'd' on multiconfig When the generator is multi config (eg MSVC, xcode) always set the debug postfix to 'd' --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 56b6e3c4f..c5d5b15b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -304,7 +304,9 @@ SET( ASSIMP_INCLUDE_INSTALL_DIR "include" CACHE STRING SET( ASSIMP_BIN_INSTALL_DIR "bin" CACHE STRING "Path the tool executables are installed to." ) -IF (CMAKE_BUILD_TYPE STREQUAL "Debug") +get_cmake_property(is_multi_config GENERATOR_IS_MULTI_CONFIG) + +IF (is_multi_config OR (CMAKE_BUILD_TYPE STREQUAL "Debug")) SET(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Debug Postfix for lib, samples and tools") ELSE() SET(CMAKE_DEBUG_POSTFIX "" CACHE STRING "Debug Postfix for lib, samples and tools") From b515f04ce6e19394121b5d01ca06f824157d4437 Mon Sep 17 00:00:00 2001 From: RichardTea <31507749+RichardTea@users.noreply.github.com> Date: Wed, 17 Apr 2019 10:48:14 +0100 Subject: [PATCH 19/34] assimp_view is ANSI (MBCS) only It should really be ported to UNICODE at some point, however I do not have the DirectX9 SDK so cannot confirm whether such a port is working. --- tools/assimp_view/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/assimp_view/CMakeLists.txt b/tools/assimp_view/CMakeLists.txt index f5365e11a..8112c19e8 100644 --- a/tools/assimp_view/CMakeLists.txt +++ b/tools/assimp_view/CMakeLists.txt @@ -88,6 +88,8 @@ SET_PROPERTY(TARGET assimp_viewer PROPERTY DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) IF ( MSVC ) ADD_DEFINITIONS( -D_SCL_SECURE_NO_WARNINGS ) ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS ) + # assimp_viewer is ANSI (MBCS) throughout + REMOVE_DEFINITIONS( -DUNICODE -D_UNICODE ) ENDIF ( MSVC ) From 58b1440fc810a207bf86fa435a88d3300f75d5db Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 26 Apr 2019 13:01:22 +0200 Subject: [PATCH 20/34] Update appveyor.yml Remove cache to fix access to not cached data. --- appveyor.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 78ef4da75..e189a71f8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -36,14 +36,14 @@ install: - ps: Invoke-WebRequest -Uri https://download.microsoft.com/download/5/7/b/57b2947c-7221-4f33-b35e-2fc78cb10df4/vc_redist.x64.exe -OutFile .\packaging\windows-innosetup\vc_redist.x64.exe - ps: Invoke-WebRequest -Uri https://download.microsoft.com/download/1/d/8/1d8137db-b5bb-4925-8c5d-927424a2e4de/vc_redist.x86.exe -OutFile .\packaging\windows-innosetup\vc_redist.x86.exe -cache: - - code\assimp.dir\%CONFIGURATION% - - contrib\zlib\zlibstatic.dir\%CONFIGURATION% - - contrib\zlib\zlib.dir\%CONFIGURATION% - - tools\assimp_cmd\assimp_cmd.dir\%CONFIGURATION% - - tools\assimp_view\assimp_viewer.dir\%CONFIGURATION% - - test\unit.dir\%CONFIGURATION% - - bin\.mtime_cache +#cache: +# - code\assimp.dir\%CONFIGURATION% +# - contrib\zlib\zlibstatic.dir\%CONFIGURATION% +# - contrib\zlib\zlib.dir\%CONFIGURATION% +# - tools\assimp_cmd\assimp_cmd.dir\%CONFIGURATION% +# - tools\assimp_view\assimp_viewer.dir\%CONFIGURATION% +# - test\unit.dir\%CONFIGURATION% +# - bin\.mtime_cache before_build: - ruby scripts\AppVeyor\mtime_cache -g scripts\AppVeyor\cacheglobs.txt -c bin\.mtime_cache\cache.json From 09905c2de39a17d8a06547779a3ff851f3d6fc60 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 26 Apr 2019 19:11:22 +0200 Subject: [PATCH 21/34] Update appveyor.yml disable vs2015 --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index e189a71f8..4b38c9cc6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,7 +15,7 @@ matrix: image: - Visual Studio 2013 - - Previous Visual Studio 2015 + #- Previous Visual Studio 2015 - Previous Visual Studio 2017 platform: From 4c3e34ba6c685b956ae2d94d288dc699b58be9ac Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 26 Apr 2019 19:28:19 +0200 Subject: [PATCH 22/34] Update Readme.md Add link to read the docs. --- Readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Readme.md b/Readme.md index 8cd3c7cb3..19e43a3cb 100644 --- a/Readme.md +++ b/Readme.md @@ -17,6 +17,8 @@ A library to import and export various 3d-model-formats including scene-post-pro APIs are provided for C and C++. There are various bindings to other languages (C#, Java, Python, Delphi, D). Assimp also runs on Android and iOS. +[Check the latest doc](https://assimp-docs.readthedocs.io/en/latest/). + Additionally, assimp features various __mesh post processing tools__: normals and tangent space generation, triangulation, vertex cache locality optimization, removal of degenerate primitives and duplicate vertices, sorting by primitive type, merging of redundant materials and many more. This is the development repo containing the latest features and bugfixes. For productive use though, we recommend one of the stable releases available from [Github Assimp Releases](https://github.com/assimp/assimp/releases). From 6d241cc2f05345a66c59a73e7d678f857a008bfa Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 26 Apr 2019 21:11:23 +0200 Subject: [PATCH 23/34] Update appveyor.yml Go back to normal --- appveyor.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 4b38c9cc6..2b5f212f9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,8 +15,8 @@ matrix: image: - Visual Studio 2013 - #- Previous Visual Studio 2015 - - Previous Visual Studio 2017 + - Visual Studio 2015 + - Visual Studio 2017 platform: - Win32 @@ -28,22 +28,22 @@ install: - set PATH=C:\Ruby24-x64\bin;%PATH% - set CMAKE_DEFINES -DASSIMP_WERROR=ON - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2013" set CMAKE_GENERATOR_NAME=Visual Studio 12 2013 - - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Previous Visual Studio 2015" set CMAKE_GENERATOR_NAME=Visual Studio 14 2015 - - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Previous Visual Studio 2017" set CMAKE_GENERATOR_NAME=Visual Studio 15 2017 + - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" set CMAKE_GENERATOR_NAME=Visual Studio 14 2015 + - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" set CMAKE_GENERATOR_NAME=Visual Studio 15 2017 - if "%platform%"=="x64" set CMAKE_GENERATOR_NAME=%CMAKE_GENERATOR_NAME% Win64 - cmake %CMAKE_DEFINES% -G "%CMAKE_GENERATOR_NAME%" - set PATH=%PATH%;"C:\\Program Files (x86)\\Inno Setup 5" - ps: Invoke-WebRequest -Uri https://download.microsoft.com/download/5/7/b/57b2947c-7221-4f33-b35e-2fc78cb10df4/vc_redist.x64.exe -OutFile .\packaging\windows-innosetup\vc_redist.x64.exe - ps: Invoke-WebRequest -Uri https://download.microsoft.com/download/1/d/8/1d8137db-b5bb-4925-8c5d-927424a2e4de/vc_redist.x86.exe -OutFile .\packaging\windows-innosetup\vc_redist.x86.exe -#cache: -# - code\assimp.dir\%CONFIGURATION% -# - contrib\zlib\zlibstatic.dir\%CONFIGURATION% -# - contrib\zlib\zlib.dir\%CONFIGURATION% -# - tools\assimp_cmd\assimp_cmd.dir\%CONFIGURATION% -# - tools\assimp_view\assimp_viewer.dir\%CONFIGURATION% -# - test\unit.dir\%CONFIGURATION% -# - bin\.mtime_cache +cache: + - code\assimp.dir\%CONFIGURATION% + - contrib\zlib\zlibstatic.dir\%CONFIGURATION% + - contrib\zlib\zlib.dir\%CONFIGURATION% + - tools\assimp_cmd\assimp_cmd.dir\%CONFIGURATION% + - tools\assimp_view\assimp_viewer.dir\%CONFIGURATION% + - test\unit.dir\%CONFIGURATION% + - bin\.mtime_cache before_build: - ruby scripts\AppVeyor\mtime_cache -g scripts\AppVeyor\cacheglobs.txt -c bin\.mtime_cache\cache.json From 085362392418e7643a96a69efcbed103fa841c3d Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sat, 27 Apr 2019 08:38:01 +0200 Subject: [PATCH 24/34] Update appveyor.yml Try this solution https://gitlab.kitware.com/cmake/cmake/commit/27eb7c5bdb5bb8deefe1772675dc4819592bf036 --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 2b5f212f9..39ef36179 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -31,7 +31,7 @@ install: - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" set CMAKE_GENERATOR_NAME=Visual Studio 14 2015 - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" set CMAKE_GENERATOR_NAME=Visual Studio 15 2017 - if "%platform%"=="x64" set CMAKE_GENERATOR_NAME=%CMAKE_GENERATOR_NAME% Win64 - - cmake %CMAKE_DEFINES% -G "%CMAKE_GENERATOR_NAME%" + - cmake %CMAKE_DEFINES% -G "%CMAKE_GENERATOR_NAME%" . - set PATH=%PATH%;"C:\\Program Files (x86)\\Inno Setup 5" - ps: Invoke-WebRequest -Uri https://download.microsoft.com/download/5/7/b/57b2947c-7221-4f33-b35e-2fc78cb10df4/vc_redist.x64.exe -OutFile .\packaging\windows-innosetup\vc_redist.x64.exe - ps: Invoke-WebRequest -Uri https://download.microsoft.com/download/1/d/8/1d8137db-b5bb-4925-8c5d-927424a2e4de/vc_redist.x86.exe -OutFile .\packaging\windows-innosetup\vc_redist.x86.exe From bcd17481e5970dba3cd68e64a32e1f8fafabf355 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Sun, 28 Apr 2019 22:16:20 -0700 Subject: [PATCH 25/34] Fix element access operator of aiColor4D --- include/assimp/color4.inl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/assimp/color4.inl b/include/assimp/color4.inl index 3192d55f3..afa53dcb5 100644 --- a/include/assimp/color4.inl +++ b/include/assimp/color4.inl @@ -85,6 +85,8 @@ AI_FORCE_INLINE TReal aiColor4t::operator[](unsigned int i) const { return g; case 2: return b; + case 3: + return a; default: break; } @@ -100,6 +102,8 @@ AI_FORCE_INLINE TReal& aiColor4t::operator[](unsigned int i) { return g; case 2: return b; + case 3: + return a; default: break; } From c821c6f30161783da1fd0a8827c118c36dcdcd33 Mon Sep 17 00:00:00 2001 From: kimkulling Date: Tue, 30 Apr 2019 15:33:31 +0200 Subject: [PATCH 26/34] Fix names of dlls. --- appveyor.yml | 9 ++- .../{script.iss => script_x64.iss} | 36 +--------- packaging/windows-innosetup/script_x86.iss | 72 +++++++++++++++++++ 3 files changed, 82 insertions(+), 35 deletions(-) rename packaging/windows-innosetup/{script.iss => script_x64.iss} (56%) create mode 100644 packaging/windows-innosetup/script_x86.iss diff --git a/appveyor.yml b/appveyor.yml index 39ef36179..c8a5a27b9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -53,7 +53,14 @@ build: project: Assimp.sln after_build: - - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" iscc packaging\windows-innosetup\script.iss + - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" ( + if "%platform%"=="x64" ( + iscc packaging\windows-innosetup\script_x64.iss + ) + if "%platform%"!="x64" ( + iscc packaging\windows-innosetup\script_x86.iss + ) + ) - 7z a assimp.7z bin\%CONFIGURATION%\* lib\%CONFIGURATION%\* test_script: diff --git a/packaging/windows-innosetup/script.iss b/packaging/windows-innosetup/script_x64.iss similarity index 56% rename from packaging/windows-innosetup/script.iss rename to packaging/windows-innosetup/script_x64.iss index 695740679..1738fd4b1 100644 --- a/packaging/windows-innosetup/script.iss +++ b/packaging/windows-innosetup/script_x64.iss @@ -24,25 +24,20 @@ Name: "compact"; Description: "Compact installation, no test models or language Name: "custom"; Description: "Custom installation"; Flags: iscustom [Components] -Name: "main"; Description: "Main Files (32 and 64 Bit)"; Types: full compact custom; Flags: fixed +Name: "main"; Description: "Main Files ( 64 Bit )"; Types: full compact custom; Flags: fixed Name: "tools"; Description: "Asset Viewer & Command Line Tools (32 and 64 Bit)"; Types: full compact Name: "help"; Description: "Help Files"; Types: full compact Name: "samples"; Description: "Samples"; Types: full Name: "test"; Description: "Test Models (BSD-licensed)"; Types: full Name: "test_nonbsd"; Description: "Test Models (other (free) licenses)"; Types: full -;Name: "pyassimp"; Description: "Python Bindings"; Types: full -;Name: "dassimp"; Description: "D Bindings"; Types: full -;Name: "assimp_net"; Description: "C#/.NET Bindings"; Types: full [Run] -;Filename: "{app}\stub\vc_redist.x86.exe"; Parameters: "/qb"; StatusMsg: "Installing VS2017 redistributable package (32 Bit)"; Check: not IsWin64 Filename: "{app}\stub\vc_redist.x64.exe"; Parameters: "/qb"; StatusMsg: "Installing VS2017 redistributable package (64 Bit)"; Check: IsWin64 [Files] Source: "readme_installer.txt"; DestDir: "{app}"; Flags: isreadme ; Installer stub -;Source: "vc_redist.x86.exe"; DestDir: "{app}\stub\"; Check: not IsWin64 Source: "vc_redist.x64.exe"; DestDir: "{app}\stub\"; Check: IsWin64 ; Common stuff @@ -53,27 +48,14 @@ Source: "WEB"; DestDir: "{app}" Source: "..\..\scripts\*"; DestDir: "{app}\scripts"; Flags: recursesubdirs -; x86 binaries -;Source: "..\..\bin\release\x86\assimp-vc140-mt.dll"; DestDir: "{app}\bin\x86" -;Source: "..\..\bin\release\x86\assimp_viewer.exe"; DestDir: "{app}\bin\x86"; Components: tools -;Source: "C:\Windows\SysWOW64\D3DCompiler_42.dll"; DestDir: "{app}\bin\x86"; Components: tools -;Source: "C:\Windows\SysWOW64\D3DX9_42.dll"; DestDir: "{app}\bin\x86"; Components: tools -;Source: "..\..\bin\release\x86\assimp.exe"; DestDir: "{app}\bin\x86"; Components: tools - ; x64 binaries -Source: "..\..\bin\release\assimp-vc140-mt.dll"; DestDir: "{app}\bin\x64" +Source: "..\..\bin\release\assimp-vc141-mt.dll"; DestDir: "{app}\bin\x64" Source: "..\..\bin\release\assimp_viewer.exe"; DestDir: "{app}\bin\x64"; Components: tools Source: "C:\Windows\SysWOW64\D3DCompiler_42.dll"; DestDir: "{app}\bin\x64"; DestName: "D3DCompiler_42.dll"; Components: tools Source: "C:\Windows\SysWOW64\D3DX9_42.dll"; DestDir: "{app}\bin\x64"; DestName: "D3DX9_42.dll"; Components: tools Source: "..\..\bin\release\assimp.exe"; DestDir: "{app}\bin\x64"; Components: tools -; Documentation -;Source: "..\..\doc\AssimpDoc_Html\AssimpDoc.chm"; DestDir: "{app}\doc"; Components: help -;Source: "..\..\doc\AssimpCmdDoc_Html\AssimpCmdDoc.chm"; DestDir: "{app}\doc"; Components: help -;Source: "..\..\doc\datastructure.xml"; DestDir: "{app}\doc"; Components: help - ; Import libraries -;Source: "..\..\lib\release\x86\assimp.lib"; DestDir: "{app}\lib\x86" Source: "..\..\lib\release\assimp-vc140-mt.lib"; DestDir: "{app}\lib\x64" ; Samples @@ -82,20 +64,6 @@ Source: "..\..\samples\*"; DestDir: "{app}\samples"; Flags: recursesubdirs; Comp ; Include files Source: "..\..\include\*"; DestDir: "{app}\include"; Flags: recursesubdirs -; dAssimp -;Source: "..\..\port\dAssimp\*"; DestDir: "{app}\port\D"; Flags: recursesubdirs; Components: dassimp - -; Assimp.NET -;Source: "..\..\port\Assimp.NET\*"; DestDir: "{app}\port\C#"; Flags: recursesubdirs; Components: assimp_net - -; PyAssimp -;Source: "..\..\port\PyAssimp\*"; DestDir: "{app}\port\Python"; Excludes: "*.pyc,*.dll"; Flags: recursesubdirs; Components: pyassimp - -; Test repository -;Source: "..\..\test\models\*"; DestDir: "{app}\test\models"; Flags: recursesubdirs; Components: test -;Source: "..\..\test\regression\*"; DestDir: "{app}\test\regression"; Flags: recursesubdirs; Components: test -;Source: "..\..\test\models-nonbsd\*"; DestDir: "{app}\test\models-nonbsd"; Flags: recursesubdirs; Components: test_nonbsd - [Icons] Name: "{group}\Assimp Manual"; Filename: "{app}\doc\AssimpDoc.chm" ; Components: help Name: "{group}\Assimp Command Line Manual"; Filename: "{app}\doc\AssimpCmdDoc.chm"; Components: help diff --git a/packaging/windows-innosetup/script_x86.iss b/packaging/windows-innosetup/script_x86.iss new file mode 100644 index 000000000..cf2660235 --- /dev/null +++ b/packaging/windows-innosetup/script_x86.iss @@ -0,0 +1,72 @@ +; Setup script for use with Inno Setup. + +[Setup] +AppName=Open Asset Import Library - SDK +AppVerName=Open Asset Import Library - SDK (v4.1.0) +DefaultDirName={pf}\Assimp +DefaultGroupName=Assimp +UninstallDisplayIcon={app}\bin\x86\assimp.exe +OutputDir=out +AppCopyright=Assimp Development Team +SetupIconFile=..\..\tools\shared\assimp_tools_icon.ico +WizardImageFile=compiler:WizModernImage-IS.BMP +WizardSmallImageFile=compiler:WizModernSmallImage-IS.BMP +LicenseFile=License.rtf +OutputBaseFileName=assimp-sdk-4.1.0-setup +VersionInfoVersion=4.1.0.0 +VersionInfoTextVersion=4.1.0 +VersionInfoCompany=Assimp Development Team +ArchitecturesInstallIn64BitMode=x64 + +[Types] +Name: "full"; Description: "Full installation" +Name: "compact"; Description: "Compact installation, no test models or language bindings" +Name: "custom"; Description: "Custom installation"; Flags: iscustom + +[Components] +Name: "main"; Description: "Main Files (32 and 64 Bit)"; Types: full compact custom; Flags: fixed +Name: "tools"; Description: "Asset Viewer & Command Line Tools (32 and 64 Bit)"; Types: full compact +Name: "help"; Description: "Help Files"; Types: full compact +Name: "samples"; Description: "Samples"; Types: full +Name: "test"; Description: "Test Models (BSD-licensed)"; Types: full +Name: "test_nonbsd"; Description: "Test Models (other (free) licenses)"; Types: full + +[Run] +Filename: "{app}\stub\vc_redist.x86.exe"; Parameters: "/qb"; StatusMsg: "Installing VS2017 redistributable package (32 Bit)"; Check: not IsWin64 + +[Files] +Source: "readme_installer.txt"; DestDir: "{app}"; Flags: isreadme + +; Installer stub +Source: "vc_redist.x86.exe"; DestDir: "{app}\stub\"; Check: not IsWin64 + +; Common stuff +Source: "..\..\CREDITS"; DestDir: "{app}" +Source: "..\..\LICENSE"; DestDir: "{app}" +Source: "..\..\README"; DestDir: "{app}" +Source: "WEB"; DestDir: "{app}" + +Source: "..\..\scripts\*"; DestDir: "{app}\scripts"; Flags: recursesubdirs + +; x86 binaries +Source: "..\..\bin\release\x86\assimp-vc141-mt.dll"; DestDir: "{app}\bin\x86" +Source: "..\..\bin\release\x86\assimp_viewer.exe"; DestDir: "{app}\bin\x86"; Components: tools +Source: "C:\Windows\SysWOW64\D3DCompiler_42.dll"; DestDir: "{app}\bin\x86"; Components: tools +Source: "C:\Windows\SysWOW64\D3DX9_42.dll"; DestDir: "{app}\bin\x86"; Components: tools +Source: "..\..\bin\release\x86\assimp.exe"; DestDir: "{app}\bin\x86"; Components: tools + + +; Import libraries +Source: "..\..\lib\release\x86\assimp.lib"; DestDir: "{app}\lib\x86" + +; Samples +Source: "..\..\samples\*"; DestDir: "{app}\samples"; Flags: recursesubdirs; Components: samples + +; Include files +Source: "..\..\include\*"; DestDir: "{app}\include"; Flags: recursesubdirs + +[Icons] +Name: "{group}\Assimp Manual"; Filename: "{app}\doc\AssimpDoc.chm" ; Components: help +Name: "{group}\Assimp Command Line Manual"; Filename: "{app}\doc\AssimpCmdDoc.chm"; Components: help +Name: "{group}\AssimpView"; Filename: "{app}\bin\x64\assimp_view.exe"; Components: tools; Check: IsWin64 +Name: "{group}\AssimpView"; Filename: "{app}\bin\x86\assimp_view.exe"; Components: tools; Check: not IsWin64 From 800616e83a7898f38ab851b4ac3144d4ad0e49d7 Mon Sep 17 00:00:00 2001 From: kimkulling Date: Tue, 30 Apr 2019 15:51:32 +0200 Subject: [PATCH 27/34] Fix if block --- appveyor.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index c8a5a27b9..851d9c096 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -56,8 +56,7 @@ after_build: - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" ( if "%platform%"=="x64" ( iscc packaging\windows-innosetup\script_x64.iss - ) - if "%platform%"!="x64" ( + ) else ( iscc packaging\windows-innosetup\script_x86.iss ) ) From a2ca6910726414c7e2eba18477e7b7e0db99b367 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 1 May 2019 11:09:20 +0200 Subject: [PATCH 28/34] Update script_x86.iss Fix invalid folder names. --- packaging/windows-innosetup/script_x86.iss | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packaging/windows-innosetup/script_x86.iss b/packaging/windows-innosetup/script_x86.iss index cf2660235..6dfba80b2 100644 --- a/packaging/windows-innosetup/script_x86.iss +++ b/packaging/windows-innosetup/script_x86.iss @@ -49,8 +49,8 @@ Source: "WEB"; DestDir: "{app}" Source: "..\..\scripts\*"; DestDir: "{app}\scripts"; Flags: recursesubdirs ; x86 binaries -Source: "..\..\bin\release\x86\assimp-vc141-mt.dll"; DestDir: "{app}\bin\x86" -Source: "..\..\bin\release\x86\assimp_viewer.exe"; DestDir: "{app}\bin\x86"; Components: tools +Source: "..\..\bin\release\assimp-vc140-mt.dll"; DestDir: "{app}\bin\x86" +Source: "..\..\bin\release\assimp_viewer.exe"; DestDir: "{app}\bin\x86"; Components: tools Source: "C:\Windows\SysWOW64\D3DCompiler_42.dll"; DestDir: "{app}\bin\x86"; Components: tools Source: "C:\Windows\SysWOW64\D3DX9_42.dll"; DestDir: "{app}\bin\x86"; Components: tools Source: "..\..\bin\release\x86\assimp.exe"; DestDir: "{app}\bin\x86"; Components: tools @@ -66,7 +66,7 @@ Source: "..\..\samples\*"; DestDir: "{app}\samples"; Flags: recursesubdirs; Comp Source: "..\..\include\*"; DestDir: "{app}\include"; Flags: recursesubdirs [Icons] -Name: "{group}\Assimp Manual"; Filename: "{app}\doc\AssimpDoc.chm" ; Components: help -Name: "{group}\Assimp Command Line Manual"; Filename: "{app}\doc\AssimpCmdDoc.chm"; Components: help -Name: "{group}\AssimpView"; Filename: "{app}\bin\x64\assimp_view.exe"; Components: tools; Check: IsWin64 -Name: "{group}\AssimpView"; Filename: "{app}\bin\x86\assimp_view.exe"; Components: tools; Check: not IsWin64 +; Name: "{group}\Assimp Manual"; Filename: "{app}\doc\AssimpDoc.chm" ; Components: help +; Name: "{group}\Assimp Command Line Manual"; Filename: "{app}\doc\AssimpCmdDoc.chm"; Components: help +; Name: "{group}\AssimpView"; Filename: "{app}\bin\x64\assimp_view.exe"; Components: tools; Check: IsWin64 +; Name: "{group}\AssimpView"; Filename: "{app}\bin\x86\assimp_view.exe"; Components: tools; Check: not IsWin64 From 6ff7635338e35ce54ced3950ade4f5271976d982 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 1 May 2019 11:10:16 +0200 Subject: [PATCH 29/34] Update script_x64.iss put icons into comments. --- packaging/windows-innosetup/script_x64.iss | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packaging/windows-innosetup/script_x64.iss b/packaging/windows-innosetup/script_x64.iss index 1738fd4b1..57182fcf5 100644 --- a/packaging/windows-innosetup/script_x64.iss +++ b/packaging/windows-innosetup/script_x64.iss @@ -65,7 +65,7 @@ Source: "..\..\samples\*"; DestDir: "{app}\samples"; Flags: recursesubdirs; Comp Source: "..\..\include\*"; DestDir: "{app}\include"; Flags: recursesubdirs [Icons] -Name: "{group}\Assimp Manual"; Filename: "{app}\doc\AssimpDoc.chm" ; Components: help -Name: "{group}\Assimp Command Line Manual"; Filename: "{app}\doc\AssimpCmdDoc.chm"; Components: help -Name: "{group}\AssimpView"; Filename: "{app}\bin\x64\assimp_view.exe"; Components: tools; Check: IsWin64 -Name: "{group}\AssimpView"; Filename: "{app}\bin\x86\assimp_view.exe"; Components: tools; Check: not IsWin64 +; Name: "{group}\Assimp Manual"; Filename: "{app}\doc\AssimpDoc.chm" ; Components: help +; Name: "{group}\Assimp Command Line Manual"; Filename: "{app}\doc\AssimpCmdDoc.chm"; Components: help +; Name: "{group}\AssimpView"; Filename: "{app}\bin\x64\assimp_view.exe"; Components: tools; Check: IsWin64 +; Name: "{group}\AssimpView"; Filename: "{app}\bin\x86\assimp_view.exe"; Components: tools; Check: not IsWin64 From 84e7f542fba2d788490584e3af37e3f4f762f24e Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 1 May 2019 12:10:52 +0200 Subject: [PATCH 30/34] Update script_x86.iss Fix version of dll. --- packaging/windows-innosetup/script_x86.iss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/windows-innosetup/script_x86.iss b/packaging/windows-innosetup/script_x86.iss index 6dfba80b2..8b8278c58 100644 --- a/packaging/windows-innosetup/script_x86.iss +++ b/packaging/windows-innosetup/script_x86.iss @@ -49,7 +49,7 @@ Source: "WEB"; DestDir: "{app}" Source: "..\..\scripts\*"; DestDir: "{app}\scripts"; Flags: recursesubdirs ; x86 binaries -Source: "..\..\bin\release\assimp-vc140-mt.dll"; DestDir: "{app}\bin\x86" +Source: "..\..\bin\release\assimp-vc141-mt.dll"; DestDir: "{app}\bin\x86" Source: "..\..\bin\release\assimp_viewer.exe"; DestDir: "{app}\bin\x86"; Components: tools Source: "C:\Windows\SysWOW64\D3DCompiler_42.dll"; DestDir: "{app}\bin\x86"; Components: tools Source: "C:\Windows\SysWOW64\D3DX9_42.dll"; DestDir: "{app}\bin\x86"; Components: tools From 615a78e38f80f8baddebb78e408b6370dc137dff Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 1 May 2019 14:41:51 +0200 Subject: [PATCH 31/34] Update script_x86.iss Fix wrong folder for assimp.exe --- packaging/windows-innosetup/script_x86.iss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/windows-innosetup/script_x86.iss b/packaging/windows-innosetup/script_x86.iss index 8b8278c58..1ecd13c7f 100644 --- a/packaging/windows-innosetup/script_x86.iss +++ b/packaging/windows-innosetup/script_x86.iss @@ -53,7 +53,7 @@ Source: "..\..\bin\release\assimp-vc141-mt.dll"; DestDir: "{app}\bin\x86" Source: "..\..\bin\release\assimp_viewer.exe"; DestDir: "{app}\bin\x86"; Components: tools Source: "C:\Windows\SysWOW64\D3DCompiler_42.dll"; DestDir: "{app}\bin\x86"; Components: tools Source: "C:\Windows\SysWOW64\D3DX9_42.dll"; DestDir: "{app}\bin\x86"; Components: tools -Source: "..\..\bin\release\x86\assimp.exe"; DestDir: "{app}\bin\x86"; Components: tools +Source: "..\..\bin\release\assimp.exe"; DestDir: "{app}\bin\x86"; Components: tools ; Import libraries From 3ee85a8cc8d117afd3987d5d9dbb24340808eeb1 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 1 May 2019 15:13:56 +0200 Subject: [PATCH 32/34] Update script_x86.iss Fix another wrong folder. --- packaging/windows-innosetup/script_x86.iss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/windows-innosetup/script_x86.iss b/packaging/windows-innosetup/script_x86.iss index 1ecd13c7f..f1999860e 100644 --- a/packaging/windows-innosetup/script_x86.iss +++ b/packaging/windows-innosetup/script_x86.iss @@ -57,7 +57,7 @@ Source: "..\..\bin\release\assimp.exe"; DestDir: "{app}\bin\x86"; Comp ; Import libraries -Source: "..\..\lib\release\x86\assimp.lib"; DestDir: "{app}\lib\x86" +Source: "..\..\lib\release\assimp.lib"; DestDir: "{app}\lib\x86" ; Samples Source: "..\..\samples\*"; DestDir: "{app}\samples"; Flags: recursesubdirs; Components: samples From c93886e87bcc315837b312d858854d422aad5a81 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 1 May 2019 15:52:27 +0200 Subject: [PATCH 33/34] Update script_x64.iss Fix eport lib name. --- packaging/windows-innosetup/script_x64.iss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/windows-innosetup/script_x64.iss b/packaging/windows-innosetup/script_x64.iss index 57182fcf5..cd4837f0a 100644 --- a/packaging/windows-innosetup/script_x64.iss +++ b/packaging/windows-innosetup/script_x64.iss @@ -56,7 +56,7 @@ Source: "C:\Windows\SysWOW64\D3DX9_42.dll"; DestDir: "{app}\bin\x64"; Dest Source: "..\..\bin\release\assimp.exe"; DestDir: "{app}\bin\x64"; Components: tools ; Import libraries -Source: "..\..\lib\release\assimp-vc140-mt.lib"; DestDir: "{app}\lib\x64" +Source: "..\..\lib\release\assimp-vc141-mt.lib"; DestDir: "{app}\lib\x64" ; Samples Source: "..\..\samples\*"; DestDir: "{app}\samples"; Flags: recursesubdirs; Components: samples From d9cfc48a665adaba251dcdf1d0fa145388812ec7 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 1 May 2019 15:53:04 +0200 Subject: [PATCH 34/34] Update script_x86.iss fix export lib name --- packaging/windows-innosetup/script_x86.iss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/windows-innosetup/script_x86.iss b/packaging/windows-innosetup/script_x86.iss index f1999860e..9aca78550 100644 --- a/packaging/windows-innosetup/script_x86.iss +++ b/packaging/windows-innosetup/script_x86.iss @@ -57,7 +57,7 @@ Source: "..\..\bin\release\assimp.exe"; DestDir: "{app}\bin\x86"; Comp ; Import libraries -Source: "..\..\lib\release\assimp.lib"; DestDir: "{app}\lib\x86" +Source: "..\..\lib\release\assimp-vc141-mt.lib"; DestDir: "{app}\lib\x86" ; Samples Source: "..\..\samples\*"; DestDir: "{app}\samples"; Flags: recursesubdirs; Components: samples