diff --git a/CMakeLists.txt b/CMakeLists.txt index d45eb2253..98cd8ce8c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,9 +56,19 @@ if(ASSIMP_BUILD_USE_CCACHE) endif() endif() -# Disabled importers: m3d for 5.1 or later -ADD_DEFINITIONS( -DASSIMP_BUILD_NO_M3D_IMPORTER) -ADD_DEFINITIONS( -DASSIMP_BUILD_NO_M3D_EXPORTER) +# User may override these in their CMake script to provide M3D import/export support +# (M3D importer/exporter was disabled for assimp release 5.1 or later) +option(ASSIMP_BUILD_M3D_IMPORTER "Enable M3D file import" off) +option(ASSIMP_BUILD_M3D_EXPORTER "Enable M3D file export" off) + +# Internal/private M3D logic +if (NOT ASSIMP_BUILD_M3D_IMPORTER) + ADD_DEFINITIONS( -DASSIMP_BUILD_NO_M3D_IMPORTER) +endif () # if (not ASSIMP_BUILD_M3D_IMPORTER) +if (NOT ASSIMP_BUILD_M3D_EXPORTER) + ADD_DEFINITIONS( -DASSIMP_BUILD_NO_M3D_EXPORTER) +endif () # if (not ASSIMP_BUILD_M3D_EXPORTER) + # Toggles the use of the hunter package manager option(ASSIMP_HUNTER_ENABLED "Enable Hunter package manager support" OFF) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 15fd2cd3e..7830baaed 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -416,14 +416,12 @@ ADD_ASSIMP_IMPORTER( LWS AssetLib/LWS/LWSLoader.h ) -ADD_ASSIMP_IMPORTER( M3D - AssetLib/M3D/M3DMaterials.h - AssetLib/M3D/M3DImporter.h - AssetLib/M3D/M3DImporter.cpp - AssetLib/M3D/M3DWrapper.h - AssetLib/M3D/M3DWrapper.cpp - AssetLib/M3D/m3d.h -) +if (ASSIMP_BUILD_M3D_IMPORTER) + ADD_ASSIMP_IMPORTER( M3D + AssetLib/M3D/M3DImporter.cpp + AssetLib/M3D/M3DWrapper.cpp + ) +endif () # if (ASSIMP_BUILD_M3D_IMPORTER) ADD_ASSIMP_IMPORTER( MD2 AssetLib/MD2/MD2FileData.h @@ -663,9 +661,10 @@ if (NOT ASSIMP_NO_EXPORT) AssetLib/Assxml/AssxmlFileWriter.h AssetLib/Assxml/AssxmlFileWriter.cpp) - ADD_ASSIMP_EXPORTER(M3D - AssetLib/M3D/M3DExporter.h - AssetLib/M3D/M3DExporter.cpp) + if ((NOT ASSIMP_NO_EXPORT) AND ASSIMP_BUILD_M3D_EXPORTER) + ADD_ASSIMP_EXPORTER(M3D + AssetLib/M3D/M3DExporter.cpp) + endif () # if (ASSIMP_BUILD_M3D_EXPORTER) ADD_ASSIMP_EXPORTER(COLLADA AssetLib/Collada/ColladaExporter.h