From bb17cfbc407c5283c571e0c0408c8b00fd41399a Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Wed, 20 May 2026 16:11:44 +1000 Subject: [PATCH] Rename Bonsai Viewer build option Replace the old IFC viewer build switch with BUILD_BONSAIVIEWER in CMake, the Linux workflows, and the nix build script. Generated with the assistance of an AI coding tool. --- .github/workflows/build_rocky.yml | 2 +- .github/workflows/build_rocky_arm.yml | 2 +- cmake/CMakeLists.txt | 12 ++++++------ nix/build-all.py | 22 ++++++++++++---------- src/ifcviewer/CMakeLists.txt | 2 +- src/ifcviewer/README.md | 2 +- 6 files changed, 22 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build_rocky.yml b/.github/workflows/build_rocky.yml index 6bb1cdceb7..0fd59ce3fd 100644 --- a/.github/workflows/build_rocky.yml +++ b/.github/workflows/build_rocky.yml @@ -57,7 +57,7 @@ jobs: shell: bash run: | set -o pipefail - CXXFLAGS="-O3" CFLAGS="-O3 ${DARWIN_C_SOURCE}" ADD_COMMIT_SHA=1 BUILD_CFG=Release BUILD_IFCVIEWER=ON python3 ./nix/build-all.py -v --diskcleanup 2>&1 | tee build.log + CXXFLAGS="-O3" CFLAGS="-O3 ${DARWIN_C_SOURCE}" ADD_COMMIT_SHA=1 BUILD_CFG=Release BUILD_BONSAIVIEWER=ON python3 ./nix/build-all.py -v --diskcleanup 2>&1 | tee build.log - name: Upload Build Logs if: always() diff --git a/.github/workflows/build_rocky_arm.yml b/.github/workflows/build_rocky_arm.yml index e2e58766fb..43fe0c72bd 100644 --- a/.github/workflows/build_rocky_arm.yml +++ b/.github/workflows/build_rocky_arm.yml @@ -57,7 +57,7 @@ jobs: shell: bash run: | set -o pipefail - CXXFLAGS="-O3" CFLAGS="-O3 ${DARWIN_C_SOURCE}" ADD_COMMIT_SHA=1 BUILD_CFG=Release BUILD_IFCVIEWER=ON python3 ./nix/build-all.py -v --diskcleanup 2>&1 | tee build.log + CXXFLAGS="-O3" CFLAGS="-O3 ${DARWIN_C_SOURCE}" ADD_COMMIT_SHA=1 BUILD_CFG=Release BUILD_BONSAIVIEWER=ON python3 ./nix/build-all.py -v --diskcleanup 2>&1 | tee build.log - name: Upload Build Logs if: always() diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index e4a185a6f3..4521785b35 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -71,8 +71,8 @@ option(BUILD_EXAMPLES "Build example applications." ON) option(BUILD_GEOMSERVER "Build IfcGeomServer executable (Open CASCADE is required)." ON) 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_IFCVIEWER "Build IfcViewer, a high-performance IFC viewer" OFF) # Requires Qt6 + OpenGL 4.5 -option(BUILD_IFCVIEWER_TESTS "Build unit tests for IfcViewer (fetches Catch2 v3)" OFF) +option(BUILD_BONSAIVIEWER "Build Bonsai Viewer" OFF) # Requires Qt6 + OpenGL 4.5 +option(BUILD_BONSAIVIEWER_TESTS "Build unit tests for Bonsai Viewer core (fetches Catch2 v3)" OFF) option(BUILD_PACKAGE "" OFF) option( @@ -547,9 +547,9 @@ if(BUILD_IFCGEOM) add_subdirectory(../src/ifcgeom ifcgeom) endif(BUILD_IFCGEOM) -if(BUILD_CONVERT OR BUILD_IFCPYTHON OR BUILD_IFCVIEWER) +if(BUILD_CONVERT OR BUILD_IFCPYTHON OR BUILD_BONSAIVIEWER) add_subdirectory(../src/serializers serializers) -endif(BUILD_CONVERT OR BUILD_IFCPYTHON OR BUILD_IFCVIEWER) +endif(BUILD_CONVERT OR BUILD_IFCPYTHON OR BUILD_BONSAIVIEWER) if(BUILD_CONVERT) add_subdirectory(../src/ifcconvert ifcconvert) @@ -667,8 +667,8 @@ if(BUILD_IFCGEOM) install(TARGETS ${IFCGEOM_SCHEMA_LIBRARIES} ${kernel_libraries} IfcGeom) endif(BUILD_IFCGEOM) -if(BUILD_IFCVIEWER) - if(BUILD_IFCVIEWER_TESTS) +if(BUILD_BONSAIVIEWER) + if(BUILD_BONSAIVIEWER_TESTS) # Catch2 v3 — fetched on demand. Test option is OFF by default so the # default build remains offline-capable. include(FetchContent) diff --git a/nix/build-all.py b/nix/build-all.py index 1b02d89a4e..6d1ab4d7db 100644 --- a/nix/build-all.py +++ b/nix/build-all.py @@ -141,7 +141,7 @@ logger.addHandler(ch) PROJECT_NAME = "IfcOpenShell" USE_CURRENT_PYTHON_VERSION = os.getenv("USE_CURRENT_PYTHON_VERSION") ADD_COMMIT_SHA = os.getenv("ADD_COMMIT_SHA") -BUILD_IFCVIEWER = os.getenv("BUILD_IFCVIEWER", "").lower() in {"1", "on", "true", "yes"} +BUILD_BONSAIVIEWER = os.getenv("BUILD_BONSAIVIEWER", "").lower() in {"1", "on", "true", "yes"} PYTHON_VERSIONS = ["3.10.3", "3.11.8", "3.12.1", "3.13.6", "3.14.0"] JSON_VERSION = "3.11.3" @@ -337,7 +337,7 @@ dependency_tree: "dict[str, tuple[str, ...]]" = { "OpenCOLLADA": ("libxml2", "pcre"), "IfcGeomServer": ("IfcGeom",), "IfcOpenShell-Python": ("python", "swig", "IfcGeom"), - "IfcViewer": ("IfcGeom", "qt6"), + "BonsaiViewer": ("IfcGeom", "qt6"), "swig": (), "boost": (), "libxml2": (), @@ -404,10 +404,10 @@ else: targets = set(dependency_tree.keys()) targets = set(t for t in targets if "without-%s" % t.lower() not in flags) -if not explicit_targets and not BUILD_IFCVIEWER: - targets.difference_update({"IfcViewer", "qt6"}) -if BUILD_IFCVIEWER: - targets.update(gather_dependencies("IfcViewer")) +if not explicit_targets and not BUILD_BONSAIVIEWER: + targets.difference_update({"BonsaiViewer", "qt6"}) +if BUILD_BONSAIVIEWER: + targets.update(gather_dependencies("BonsaiViewer")) if WASM: SKIP_TARGETS_FOR_WASM = { "rocksdb", @@ -417,7 +417,7 @@ if WASM: "IfcGeom", "IfcConvert", "IfcGeomServer", - "IfcViewer", + "BonsaiViewer", "qt6", } SKIP_TARGETS_FOR_WASM = {t.lower() for t in SKIP_TARGETS_FOR_WASM} @@ -1457,18 +1457,20 @@ if os.environ.get("QT_DIR"): cmake_args_prefix_path.append(os.environ["QT_DIR"]) cmake_args.append(f"-DQT_DIR={os.environ['QT_DIR']}") -build_ifcviewer = BUILD_IFCVIEWER or "IfcViewer" in targets +build_bonsaiviewer = BUILD_BONSAIVIEWER or "BonsaiViewer" in targets ifcos_build_args = [ f"-DBUILD_IFCGEOM={OFF_ON['IfcGeom' in targets]}", f"-DBUILD_GEOMSERVER={OFF_ON['IfcGeomServer' in targets]}", f"-DBUILD_CONVERT={OFF_ON['IfcConvert' in targets]}", - f"-DBUILD_IFCVIEWER={OFF_ON[build_ifcviewer]}", + f"-DBUILD_BONSAIVIEWER={OFF_ON[build_bonsaiviewer]}", f"-DCMAKE_INSTALL_PREFIX={DEPS_DIR}/install/ifcopenshell", ] if not WASM and ( - build_ifcviewer or not explicit_targets or {"IfcGeom", "IfcConvert", "IfcGeomServer", "IfcViewer"} & set(explicit_targets) + build_bonsaiviewer + or not explicit_targets + or {"IfcGeom", "IfcConvert", "IfcGeomServer", "BonsaiViewer"} & set(explicit_targets) ): logger.info("\rConfiguring executables...") diff --git a/src/ifcviewer/CMakeLists.txt b/src/ifcviewer/CMakeLists.txt index 176e380498..e3d847efe0 100644 --- a/src/ifcviewer/CMakeLists.txt +++ b/src/ifcviewer/CMakeLists.txt @@ -76,6 +76,6 @@ install(FILES ${IFCVIEWER_H_FILES} DESTINATION ${INCLUDEDIR}/ifcviewer ) -if(BUILD_IFCVIEWER_TESTS) +if(BUILD_BONSAIVIEWER_TESTS) add_subdirectory(tests) endif() diff --git a/src/ifcviewer/README.md b/src/ifcviewer/README.md index efc59ccb63..bafb1664b4 100644 --- a/src/ifcviewer/README.md +++ b/src/ifcviewer/README.md @@ -143,7 +143,7 @@ mkdir build && cd build cmake ../cmake \ -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_IFCVIEWER=ON \ + -DBUILD_BONSAIVIEWER=ON \ -DBUILD_CONVERT=OFF \ -DBUILD_IFCPYTHON=OFF \ -DBUILD_GEOMSERVER=OFF \