- add ASSIMP_BUILD_NO_COMPRESSED_IFC option. Properly integrate Q3BSP's unzip dependency into the build configuration.
parent
9379e63636
commit
bdfcb4b0cb
|
@ -48,7 +48,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <boost/tuple/tuple.hpp>
|
#include <boost/tuple/tuple.hpp>
|
||||||
|
|
||||||
#include "../contrib/unzip/unzip.h"
|
#ifndef ASSIMP_BUILD_NO_COMPRESSED_IFC
|
||||||
|
# include "../contrib/unzip/unzip.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "IFCLoader.h"
|
#include "IFCLoader.h"
|
||||||
#include "STEPFileReader.h"
|
#include "STEPFileReader.h"
|
||||||
|
@ -169,8 +171,10 @@ void IFCImporter::InternReadFile( const std::string& pFile,
|
||||||
ThrowException("Could not open file for reading");
|
ThrowException("Could not open file for reading");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// if this is a ifczip file, decompress its contents first
|
// if this is a ifczip file, decompress its contents first
|
||||||
if(GetExtension(pFile) == "ifczip") {
|
if(GetExtension(pFile) == "ifczip") {
|
||||||
|
#ifndef ASSIMP_BUILD_NO_COMPRESSED_IFC
|
||||||
unzFile zip = unzOpen( pFile.c_str() );
|
unzFile zip = unzOpen( pFile.c_str() );
|
||||||
if(zip == NULL) {
|
if(zip == NULL) {
|
||||||
ThrowException("Could not open ifczip file for reading, unzip failed");
|
ThrowException("Could not open ifczip file for reading, unzip failed");
|
||||||
|
@ -214,6 +218,9 @@ void IFCImporter::InternReadFile( const std::string& pFile,
|
||||||
}
|
}
|
||||||
|
|
||||||
unzClose(zip);
|
unzClose(zip);
|
||||||
|
#else
|
||||||
|
ThrowException("Could not open ifczip file for reading, assimp was built without ifczip support");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::scoped_ptr<STEP::DB> db(STEP::ReadFileHeader(stream));
|
boost::scoped_ptr<STEP::DB> db(STEP::ReadFileHeader(stream));
|
||||||
|
|
|
@ -60,9 +60,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* Other (mixed) configuration switches are listed here:
|
* Other (mixed) configuration switches are listed here:
|
||||||
* ASSIMP_BUILD_NO_COMPRESSED_X
|
* ASSIMP_BUILD_NO_COMPRESSED_X
|
||||||
* - Disable support for compressed X files
|
* - Disable support for compressed X files (zip)
|
||||||
* ASSIMP_BUILD_NO_COMPRESSED_BLEND
|
* ASSIMP_BUILD_NO_COMPRESSED_BLEND
|
||||||
* - Disable support for compressed Blender files*/
|
* - Disable support for compressed Blender files (zip)
|
||||||
|
* ASSIMP_BUILD_NO_COMPRESSED_IFC
|
||||||
|
* - Disable support for IFCZIP files (unzip)
|
||||||
|
*/
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_COMPRESSED_X
|
#ifndef ASSIMP_BUILD_NO_COMPRESSED_X
|
||||||
|
@ -71,6 +74,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_COMPRESSED_BLEND
|
#ifndef ASSIMP_BUILD_NO_COMPRESSED_BLEND
|
||||||
# define ASSIMP_BUILD_NEED_Z_INFLATE
|
# define ASSIMP_BUILD_NEED_Z_INFLATE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef ASSIMP_BUILD_NO_COMPRESSED_IFC
|
||||||
|
# define ASSIMP_BUILD_NEED_Z_INFLATE
|
||||||
|
# define ASSIMP_BUILD_NEED_UNZIP
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef ASSIMP_BUILD_NO_Q3BSP_IMPORTER
|
||||||
|
# define ASSIMP_BUILD_NEED_Z_INFLATE
|
||||||
|
# define ASSIMP_BUILD_NEED_UNZIP
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Reference in New Issue