From 92964fb5ef206f70893e48e13747592b5b8880de Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Fri, 12 Dec 2025 13:43:09 +0500 Subject: [PATCH] cmake - option to build only common schemas --- cmake/CMakeLists.txt | 11 +++++++++-- src/ifcparse/CMakeLists.txt | 1 - 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 0f71a00b1d..0947a74b01 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -80,6 +80,13 @@ option(BUILD_GEOMSERVER "Build IfcGeomServer executable (Open CASCADE is require option(BUILD_IFCMAX "Build IfcMax, a 3ds Max plug-in, Windows-only." OFF) option(BUILD_QTVIEWER "Build IfcOpenShell Qt GUI Viewer" OFF) # QtViewer requires Qt6 option(BUILD_PACKAGE "" OFF) +# Most users probably need just common schemas, +# but we're keeping it `OFF` by default to avoid disruption +# (e.g. all Python distribution would need to adapt this option to be set). +option(BUILD_ONLY_COMMON_SCHEMAS + "Build only common IFC schemas (2x3, 4, 4x3_add2). By default all schemas will be built." + OFF) +option(SCHEMA_VERSIONS "Explicitly specify schemas to build." "") option(WITH_OPENCASCADE "Enable geometry interpretation using Open CASCADE" ON) option(WITH_CGAL "Enable geometry interpretation using CGAL" ON) @@ -449,8 +456,8 @@ include_directories(${OPENCOLLADA_INCLUDE_DIRS} ) if(NOT SCHEMA_VERSIONS) - if(WASM_BUILD) - # super arbitrarily try to keep size down at least a little bit + # `WASM_BUILD` - super arbitrarily try to keep size down at least a little bit + if(BUILD_ONLY_COMMON_SCHEMAS OR WASM_BUILD) set(SCHEMA_VERSIONS "2x3" "4" "4x3_add2") else() set(SCHEMA_VERSIONS "2x3" "4" "4x1" "4x2" "4x3" "4x3_tc1" "4x3_add1" "4x3_add2") diff --git a/src/ifcparse/CMakeLists.txt b/src/ifcparse/CMakeLists.txt index f7d3f06f3b..ba99329601 100644 --- a/src/ifcparse/CMakeLists.txt +++ b/src/ifcparse/CMakeLists.txt @@ -17,7 +17,6 @@ foreach(file ${IFCPARSE_CPP_FILES_ALL}) endif() endforeach() -message(STATUS "SCHEMA_VERSIONS from ifcparse: ${SCHEMA_VERSIONS}") foreach(schema ${SCHEMA_VERSIONS}) list(APPEND IFCPARSE_H_FILES Ifc${schema}.h