Moved private headers to code/ as discussed; removed boost::random workaround which was no longer needed; CMake cleanup part two (Boost detection, …).

Please be quick to suspect this commit if the build should break on Windows/MSVC.

(Again, sorry for the large commit, but I didnt want to flood the commit log with my git-style tiny commits.)

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@577 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
pull/1/head
klickverbot 2010-03-03 21:48:23 +00:00
parent ee6c6e5187
commit ac8479f542
24 changed files with 109 additions and 222 deletions

View File

@ -6,9 +6,13 @@ INCLUDE_DIRECTORIES( include )
SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/lib )
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/bin )
SET( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib" )
SET( INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" )
SET( BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin" )
# Cache these to allow the user to override them manually.
SET( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH
"Path the built library files are installed to." )
SET( INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH
"Path the header files are installed to." )
SET( BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH
"Path the tool executables are installed to." )
# Libs
ADD_SUBDIRECTORY( code/ )

View File

@ -57,7 +57,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/* Include our stdint.h replacement header for MSVC, take the global header for gcc/mingw
*/
#ifdef _MSC_VER
# include "../include/Compiler/pstdint.h"
# include "pstdint.h"
#else
# include <stdint.h>
#endif
@ -134,28 +134,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "qnan.h"
// ----------------------------------------------------------------------------------------
/* boost headers - if -noboost is enabled, take it from the workaround directory
* using hardcoded paths. This has the advantage that the user doesn't need to specify
* 'include/BoostWorkaround' as additional include path.
*/
// ----------------------------------------------------------------------------------------
#ifdef ASSIMP_BUILD_BOOST_WORKAROUND
#include <boost/scoped_ptr.hpp>
#include <boost/scoped_array.hpp>
#include <boost/format.hpp>
#include <boost/foreach.hpp>
#include <boost/static_assert.hpp>
# include "../include/BoostWorkaround/boost/scoped_ptr.hpp"
# include "../include/BoostWorkaround/boost/scoped_array.hpp"
# include "../include/BoostWorkaround/boost/format.hpp"
# include "../include/BoostWorkaround/boost/foreach.hpp"
# include "../include/BoostWorkaround/boost/static_assert.hpp"
#else
# include <boost/scoped_ptr.hpp>
# include <boost/scoped_array.hpp>
# include <boost/format.hpp>
# include <boost/foreach.hpp>
# include <boost/static_assert.hpp>
#endif // ! ASSIMP_BUILD_BOOST_WORKAROUND
#endif // !! ASSIMP_PCH_INCLUDED

View File

@ -1,11 +1,35 @@
SET( LIBRARY_VERSION "1.0.0" )
SET( LIBRARY_SOVERSION "1" )
IF ( ENABLE_BOOST_WORKAROUND )
INCLUDE_DIRECTORIES( BoostWorkaround )
ADD_DEFINITIONS( -DASSIMP_BUILD_BOOST_WORKAROUND )
MESSAGE( STATUS "Building a non-boost version of Assimp." )
ELSE ( ENABLE_BOOST_WORKAROUND )
FIND_PACKAGE( Boost 1.35 )
IF ( NOT Boost_FOUND )
MESSAGE( FATAL_ERROR
"Boost libraries (http://www.boost.org/) not found. "
"You can build a non-boost version of Assimp with slightly reduced "
"functionality by specifying -DENABLE_BOOST_WORKAROUND=ON."
)
ENDIF ( NOT Boost_FOUND )
INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIRS} )
ENDIF ( ENABLE_BOOST_WORKAROUND )
#
# Listing and grouping of all the source files for use with IDE project
# generators.
#
SET( HEADER_PATH ../include )
SET( COMPILER_HEADERS
${HEADER_PATH}/Compiler/pushpack1.h
${HEADER_PATH}/Compiler/poppack1.h
pstdint.h
)
SET( PUBLIC_HEADERS
@ -44,19 +68,18 @@ SET( PUBLIC_HEADERS
${HEADER_PATH}/NullLogger.h
)
SOURCE_GROUP( Compiler FILES
${HEADER_PATH}/Compiler/pushpack1.h
SOURCE_GROUP( Compiler FILES ${HEADER_PATH}/Compiler/pushpack1.h
${HEADER_PATH}/Compiler/poppack1.h
)
SOURCE_GROUP( Boost FILES
${HEADER_PATH}/BoostWorkaround/boost/common_factor_rt.hpp
${HEADER_PATH}/BoostWorkaround/boost/foreach.hpp
${HEADER_PATH}/BoostWorkaround/boost/format.hpp
${HEADER_PATH}/BoostWorkaround/boost/scoped_array.hpp
${HEADER_PATH}/BoostWorkaround/boost/scoped_ptr.hpp
${HEADER_PATH}/BoostWorkaround/boost/static_assert.hpp
${HEADER_PATH}/BoostWorkaround/boost/tuple/tuple.hpp
BoostWorkaround/boost/math/common_factor_rt.hpp
BoostWorkaround/boost/foreach.hpp
BoostWorkaround/boost/format.hpp
BoostWorkaround/boost/scoped_array.hpp
BoostWorkaround/boost/scoped_ptr.hpp
BoostWorkaround/boost/static_assert.hpp
BoostWorkaround/boost/tuple/tuple.hpp
)
SOURCE_GROUP( Logging FILES
@ -638,13 +661,13 @@ ADD_LIBRARY( assimp SHARED
MS3DLoader.cpp
# Necessary to show the headers in the project when using the VC++ generator:
${HEADER_PATH}/BoostWorkaround/boost/common_factor_rt.hpp
${HEADER_PATH}/BoostWorkaround/boost/foreach.hpp
${HEADER_PATH}/BoostWorkaround/boost/format.hpp
${HEADER_PATH}/BoostWorkaround/boost/scoped_array.hpp
${HEADER_PATH}/BoostWorkaround/boost/scoped_ptr.hpp
${HEADER_PATH}/BoostWorkaround/boost/static_assert.hpp
${HEADER_PATH}/BoostWorkaround/boost/tuple/tuple.hpp
BoostWorkaround/boost/math/common_factor_rt.hpp
BoostWorkaround/boost/foreach.hpp
BoostWorkaround/boost/format.hpp
BoostWorkaround/boost/scoped_array.hpp
BoostWorkaround/boost/scoped_ptr.hpp
BoostWorkaround/boost/static_assert.hpp
BoostWorkaround/boost/tuple/tuple.hpp
${PUBLIC_HEADERS}
${COMPILER_HEADERS}
)

View File

@ -55,16 +55,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// We need boost::common_factor to compute the lcm/gcd of a number
#ifdef ASSIMP_BUILD_BOOST_WORKAROUND
# include "../include/BoostWorkaround/boost/common_factor_rt.hpp"
#else
# include <boost/math/common_factor_rt.hpp>
#endif
#include <boost/math/common_factor_rt.hpp>
using namespace Assimp;
using namespace irr;
using namespace irr::io;
using namespace boost::math;
// ------------------------------------------------------------------------------------------------

View File

@ -46,7 +46,7 @@ CPPFLAGS=-Wall
# Setup environment for noboost build
ifeq ($(NOBOOST),1)
SINGLETHREADED = 1
INCLUDEFLAGS += -I../include/BoostWorkaround/
INCLUDEFLAGS += -IBoostWorkaround/
DEFINEFLAGS += -DASSIMP_BUILD_BOOST_WORKAROUND
# NAMESUFFIX += -noboost
# else

View File

@ -127,7 +127,7 @@ FILE_PATTERNS = *.c \
*.dox \
*.py
RECURSIVE = YES
EXCLUDE = ../include/BoostWorkaround
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = */.svn/* \
*/.svn

View File

@ -125,7 +125,7 @@ FILE_PATTERNS = *.c \
*.dox \
*.py
RECURSIVE = YES
EXCLUDE = ../include/BoostWorkaround
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = */.svn/* \
*/.svn

View File

@ -1,26 +0,0 @@
#ifndef BOOST_MT_INCLUDED
#define BOOST_MT_INCLUDED
namespace boost
{
// A very minimal implementation. No mersenne_twister at all,
// but it should generate some randomness though
class mt19937
{
public:
mt19937(unsigned int seed)
{
::srand(seed);
}
unsigned int operator () (void)
{
return ::rand();
}
};
};
#endif

View File

@ -1,30 +0,0 @@
#ifndef BOOST_UNIFORM_INT_INCLUDED
#define BOOST_UNIFORM_INT_INCLUDED
namespace boost
{
template <typename IntType = unsigned int>
class uniform_int
{
public:
typedef IntType type;
uniform_int (IntType _first, IntType _last)
: first (_first)
, last (_last)
{}
IntType operator () (IntType in)
{
return (IntType)((in * ((last-first)/RAND_MAX)) + first);
}
private:
IntType first, last;
};
};
#endif // BOOST_UNIFORM_INT_INCLUDED

View File

@ -1,31 +0,0 @@
#ifndef BOOST_VG_INCLUDED
#define BOOST_VG_INCLUDED
namespace boost
{
template <typename Random, typename Distribution>
class variate_generator
{
public:
variate_generator (Random _rnd, Distribution _dist)
: rnd (_rnd)
, dist (_dist)
{}
typename Distribution::type operator () ()
{
return dist ( rnd () );
}
private:
Random rnd;
Distribution dist;
};
} // end namespace boost
#endif

View File

@ -1,10 +1,11 @@
include_directories (
INCLUDE_DIRECTORIES(
${AssetImporter_SOURCE_DIR}/include
${AssetImporter_SOURCE_DIR}/code
)
# Make sure the linker can find the Hello library once it is built.
link_directories (${AssetImporter_BINARY_DIR} ${AssetImporter_BINARY_DIR}/lib)
# Add the temporary output directories to the library path to make sure the
# Assimp library can be found, even if it is not installed system-wide yet.
LINK_DIRECTORIES( ${AssetImporter_BINARY_DIR} ${AssetImporter_BINARY_DIR}/lib )
SOURCE_GROUP( unit FILES
unit/CCompilerTest.c
@ -115,7 +116,6 @@ IF( WIN32 )
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK/Include"
DOC "The directory where D3D9.h resides")
FIND_LIBRARY(D3D9_LIBRARY d3d9.lib
PATHS
"$ENV{DXSDK_DIR}/Lib/x86"
@ -137,6 +137,5 @@ IF( WIN32 )
)
ENDIF( WIN32 )
# Link the executable to the Hello library.
# TODO: Port to non-Windows platforms.
target_link_libraries ( unit assimp ${DX9_LIBRARIES} comctl32.lib Winmm.lib )

View File

@ -1,6 +1,4 @@
#include "../../../include/BoostWorkaround/boost/tuple/tuple.hpp"
#include "BoostWorkaround/boost/tuple/tuple.hpp"
struct another
{int dummy;};

View File

@ -43,11 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef AV_ANIMEVALUATOR_H_INCLUDED
#define AV_ANIMEVALUATOR_H_INCLUDED
#ifdef ASSIMP_BUILD_BOOST_WORKAROUND
# include "BoostWorkaround/boost/tuple/tuple.hpp"
#else
# include <boost/tuple/tuple.hpp>
#endif
#include <boost/tuple/tuple.hpp>
namespace AssimpView
{

View File

@ -626,7 +626,7 @@
FavorSizeOrSpeed="0"
OmitFramePointers="true"
WholeProgramOptimization="false"
AdditionalIncludeDirectories=""
AdditionalIncludeDirectories="..\..\code\BoostWorkaround"
PreprocessorDefinitions="NDEBUG;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;ASSIMP_BUILD_BOOST_WORKAROUND"
StringPooling="true"
RuntimeLibrary="2"
@ -693,7 +693,7 @@
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="0"
AdditionalIncludeDirectories=""
AdditionalIncludeDirectories="..\..\code\BoostWorkaround"
PreprocessorDefinitions="NDEBUG;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;ASSIMP_BUILD_BOOST_WORKAROUND"
StringPooling="true"
RuntimeLibrary="2"
@ -758,7 +758,7 @@
Optimization="0"
FavorSizeOrSpeed="0"
WholeProgramOptimization="false"
AdditionalIncludeDirectories=""
AdditionalIncludeDirectories="..\..\code\BoostWorkaround"
PreprocessorDefinitions="DEBUG;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;ASSIMP_BUILD_BOOST_WORKAROUND"
BasicRuntimeChecks="3"
SmallerTypeCheck="true"
@ -824,7 +824,7 @@
Name="VCCLCompilerTool"
Optimization="0"
FavorSizeOrSpeed="0"
AdditionalIncludeDirectories=""
AdditionalIncludeDirectories="..\..\code\BoostWorkaround"
PreprocessorDefinitions="DEBUG;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;ASSIMP_BUILD_BOOST_WORKAROUND"
BasicRuntimeChecks="3"
SmallerTypeCheck="true"
@ -1141,7 +1141,7 @@
>
</File>
<File
RelativePath="..\..\include\Compiler\pstdint.h"
RelativePath="..\..\code\pstdint.h"
>
</File>
<File
@ -1152,10 +1152,6 @@
<Filter
Name="BoostWorkaround"
>
<File
RelativePath="..\..\include\BoostWorkaround\boost\common_factor_rt.hpp"
>
</File>
<File
RelativePath="..\..\include\BoostWorkaround\boost\foreach.hpp"
>
@ -1176,22 +1172,6 @@
RelativePath="..\..\include\BoostWorkaround\boost\static_assert.hpp"
>
</File>
<Filter
Name="random"
>
<File
RelativePath="..\..\include\BoostWorkaround\boost\random\mersenne_twister.hpp"
>
</File>
<File
RelativePath="..\..\include\BoostWorkaround\boost\random\uniform_int.hpp"
>
</File>
<File
RelativePath="..\..\include\BoostWorkaround\boost\random\variate_generator.hpp"
>
</File>
</Filter>
<Filter
Name="tuple"
>
@ -1200,6 +1180,14 @@
>
</File>
</Filter>
<Filter
Name="math"
>
<File
RelativePath="..\..\include\BoostWorkaround\boost\math\common_factor_rt.hpp"
>
</File>
</Filter>
</Filter>
<Filter
Name="C"

View File

@ -333,7 +333,7 @@
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="0"
OmitFramePointers="true"
AdditionalIncludeDirectories=""
AdditionalIncludeDirectories="..\..\code\BoostWorkaround"
PreprocessorDefinitions="NDEBUG;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;ASSIMP_BUILD_BOOST_WORKAROUND"
StringPooling="true"
RuntimeLibrary="2"
@ -396,7 +396,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
AdditionalIncludeDirectories="..\..\code\BoostWorkaround"
PreprocessorDefinitions="DEBUG;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;ASSIMP_BUILD_BOOST_WORKAROUND"
BasicRuntimeChecks="3"
SmallerTypeCheck="true"
@ -872,7 +872,7 @@
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories=""
AdditionalIncludeDirectories="..\..\code\BoostWorkaround"
PreprocessorDefinitions="NDEBUG;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;ASSIMP_BUILD_BOOST_WORKAROUND"
StringPooling="true"
RuntimeLibrary="2"
@ -934,7 +934,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
AdditionalIncludeDirectories="..\..\code\BoostWorkaround"
PreprocessorDefinitions="DEBUG;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;ASSIMP_BUILD_BOOST_WORKAROUND"
BasicRuntimeChecks="3"
SmallerTypeCheck="true"
@ -1112,7 +1112,7 @@
>
</File>
<File
RelativePath="..\..\include\Compiler\pstdint.h"
RelativePath="..\..\code\pstdint.h"
>
</File>
<File
@ -1124,50 +1124,38 @@
Name="BoostWorkaround"
>
<File
RelativePath="..\..\include\BoostWorkaround\boost\common_factor_rt.hpp"
RelativePath="..\..\code\BoostWorkaround\boost\foreach.hpp"
>
</File>
<File
RelativePath="..\..\include\BoostWorkaround\boost\foreach.hpp"
RelativePath="..\..\code\BoostWorkaround\boost\format.hpp"
>
</File>
<File
RelativePath="..\..\include\BoostWorkaround\boost\format.hpp"
RelativePath="..\..\code\BoostWorkaround\boost\scoped_array.hpp"
>
</File>
<File
RelativePath="..\..\include\BoostWorkaround\boost\scoped_array.hpp"
RelativePath="..\..\code\BoostWorkaround\boost\scoped_ptr.hpp"
>
</File>
<File
RelativePath="..\..\include\BoostWorkaround\boost\scoped_ptr.hpp"
RelativePath="..\..\code\BoostWorkaround\boost\static_assert.hpp"
>
</File>
<File
RelativePath="..\..\include\BoostWorkaround\boost\static_assert.hpp"
>
</File>
<Filter
Name="random"
>
<File
RelativePath="..\..\include\BoostWorkaround\boost\random\mersenne_twister.hpp"
>
</File>
<File
RelativePath="..\..\include\BoostWorkaround\boost\random\uniform_int.hpp"
>
</File>
<File
RelativePath="..\..\include\BoostWorkaround\boost\random\variate_generator.hpp"
>
</File>
</Filter>
<Filter
Name="tuple"
>
<File
RelativePath="..\..\include\BoostWorkaround\boost\tuple\tuple.hpp"
RelativePath="..\..\code\BoostWorkaround\boost\tuple\tuple.hpp"
>
</File>
</Filter>
<Filter
Name="math"
>
<File
RelativePath="..\..\code\BoostWorkaround\boost\math\common_factor_rt.hpp"
>
</File>
</Filter>

View File

@ -6,6 +6,7 @@
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\code\BoostWorkaround"
PreprocessorDefinitions="ASSIMP_BUILD_BOOST_WORKAROUND;ASSIMP_BUILD_SINGLETHREADED"
/>
</VisualStudioPropertySheet>