diff --git a/CMakeLists.txt b/CMakeLists.txt index cf64e9ef3..6fef21202 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,10 +7,37 @@ set (ASSIMP_VERSION_MINOR 0) set (ASSIMP_VERSION_PATCH 1) # subversion revision? set (ASSIMP_VERSION ${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}.${ASSIMP_VERSION_PATCH}) set (ASSIMP_SOVERSION 3) -SET ( PROJECT_VERSION "${ASSIMP_VERSION}" ) +set (PROJECT_VERSION "${ASSIMP_VERSION}") set(ASSIMP_PACKAGE_VERSION "0" CACHE STRING "the package-specific version used for uploading the sources") +# Get the current working branch +execute_process( + COMMAND git rev-parse --abbrev-ref HEAD + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE GIT_BRANCH + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +# Get the latest abbreviated commit hash of the working branch +execute_process( + COMMAND git log -1 --format=%h + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE GIT_COMMIT_HASH + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +if(NOT GIT_COMMIT_HASH) + set(GIT_COMMIT_HASH 0) +endif(NOT GIT_COMMIT_HASH) + +configure_file( + ${CMAKE_SOURCE_DIR}/revision.h.in + ${CMAKE_BINARY_DIR}/revision.h +) + +include_directories(${CMAKE_BINARY_DIR}) + option(ASSIMP_OPT_BUILD_PACKAGES "Set to ON to generate CPack configuration files and packaging targets" OFF) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules" ) set(LIBASSIMP_COMPONENT "libassimp${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_MINOR}.${ASSIMP_VERSION_PATCH}" ) diff --git a/code/AssimpPCH.cpp b/code/AssimpPCH.cpp index 1a3c86d29..62df955de 100644 --- a/code/AssimpPCH.cpp +++ b/code/AssimpPCH.cpp @@ -63,7 +63,7 @@ ASSIMP_API unsigned int aiGetCompileFlags () { } // include current build revision, which is even updated from time to time -- :-) -#include "../revision.h" +#include "revision.h" // ------------------------------------------------------------------------------------------------ ASSIMP_API unsigned int aiGetVersionRevision () diff --git a/code/BoostWorkaround/boost/shared_array.hpp b/code/BoostWorkaround/boost/shared_array.hpp index 47bb4cf6f..2d068d556 100644 --- a/code/BoostWorkaround/boost/shared_array.hpp +++ b/code/BoostWorkaround/boost/shared_array.hpp @@ -2,7 +2,7 @@ #ifndef INCLUDED_AI_BOOST_SHARED_ARRAY #define INCLUDED_AI_BOOST_SHARED_ARRAY -#ifndef BOOST_SCOPED_ARRAY_HPP_INCLUDED +#ifndef BOOST_SHARED_ARRAY_HPP_INCLUDED // ------------------------------ // Internal stub diff --git a/code/BoostWorkaround/boost/shared_ptr.hpp b/code/BoostWorkaround/boost/shared_ptr.hpp index bb7db3662..590e2ce87 100644 --- a/code/BoostWorkaround/boost/shared_ptr.hpp +++ b/code/BoostWorkaround/boost/shared_ptr.hpp @@ -2,7 +2,7 @@ #ifndef INCLUDED_AI_BOOST_SHARED_PTR #define INCLUDED_AI_BOOST_SHARED_PTR -#ifndef BOOST_SCOPED_PTR_HPP_INCLUDED +#ifndef BOOST_SHARED_PTR_HPP_INCLUDED // ------------------------------ // Internal stub @@ -254,4 +254,4 @@ inline shared_ptr const_pointer_cast( shared_ptr ptr) #else # error "shared_ptr.h was already included" #endif -#endif // INCLUDED_AI_BOOST_SCOPED_PTR +#endif // INCLUDED_AI_BOOST_SHARED_PTR diff --git a/include/assimp/vector3.h b/include/assimp/vector3.h index 9edaf5bf6..a4c33b194 100644 --- a/include/assimp/vector3.h +++ b/include/assimp/vector3.h @@ -88,6 +88,7 @@ public: // comparison bool operator== (const aiVector3t& other) const; bool operator!= (const aiVector3t& other) const; + bool operator < (const aiVector3t& other) const; bool Equal(const aiVector3t& other, TReal epsilon = 1e-6) const; diff --git a/include/assimp/vector3.inl b/include/assimp/vector3.inl index 93f317645..f69bea9a6 100644 --- a/include/assimp/vector3.inl +++ b/include/assimp/vector3.inl @@ -159,6 +159,11 @@ AI_FORCE_INLINE bool aiVector3t::Equal(const aiVector3t& other, TR } // ------------------------------------------------------------------------------------------------ template +AI_FORCE_INLINE bool aiVector3t::operator < (const aiVector3t& other) const { + return x != other.x ? x < other.x : y != other.y ? y < other.y : z < other.z; +} +// ------------------------------------------------------------------------------------------------ +template AI_FORCE_INLINE const aiVector3t aiVector3t::SymMul(const aiVector3t& o) { return aiVector3t(x*o.x,y*o.y,z*o.z); } diff --git a/revision.h b/revision.h.in similarity index 54% rename from revision.h rename to revision.h.in index 8ed82b1ac..719447831 100644 --- a/revision.h +++ b/revision.h.in @@ -1,6 +1,7 @@ #ifndef ASSIMP_REVISION_H_INC #define ASSIMP_REVISION_H_INC -#define GitVersion 0xA0bA3A8; +#define GitVersion 0x@GIT_COMMIT_HASH@ +#define GitBranch "@GIT_BRANCH@" #endif // ASSIMP_REVISION_H_INC diff --git a/test/models/PLY/pond.0.ply b/test/models/PLY/pond.0.ply new file mode 100644 index 000000000..a45e0322d Binary files /dev/null and b/test/models/PLY/pond.0.ply differ diff --git a/tools/assimp_cmd/Main.cpp b/tools/assimp_cmd/Main.cpp index c5c1de6fd..b0cf6beb3 100644 --- a/tools/assimp_cmd/Main.cpp +++ b/tools/assimp_cmd/Main.cpp @@ -51,7 +51,7 @@ const char* AICMD_MSG_ABOUT = " -- Commandline toolchain --\n" "------------------------------------------------------ \n\n" -"Version %i.%i %s%s%s%s%s(SVNREV %i)\n\n"; +"Version %i.%i %s%s%s%s%s(GIT commit %x)\n\n"; const char* AICMD_MSG_HELP = "assimp \n\n"