Skip to content

Commit 2a2bb24

Browse files
authored
Add webifc to superbuild (#304)
1 parent c2fb526 commit 2a2bb24

File tree

8 files changed

+59
-4
lines changed

8 files changed

+59
-4
lines changed

.github/actions/f3d-superbuild/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ runs:
101101
-Dvtk_SOURCE_SELECTION=git
102102
${{ runner.os == 'Linux' && '-DENABLE_egl=ON -DENABLE_osmesa=ON' || null }}
103103
${{ runner.os == 'Windows' && '-G Ninja' || null }}
104-
${{ runner.os == 'macOS' && '-DCMAKE_OSX_DEPLOYMENT_TARGET=12.0' || null }}
104+
${{ runner.os == 'macOS' && '-DCMAKE_OSX_DEPLOYMENT_TARGET=14.0' || null }}
105105
106106
- name: Disable LFS during the build
107107
working-directory: ${{github.workspace}}

.github/actions/wheels/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ runs:
4141
uses: actions/cache@v4
4242
with:
4343
path: fsbb/install
44-
key: fsbb-${{runner.os}}-${{env.VTK_COMMIT_SHA}}-2
44+
key: fsbb-${{runner.os}}-${{env.VTK_COMMIT_SHA}}-3
4545

4646
- name: Setup Ninja Windows
4747
if: runner.os == 'Windows'

.github/actions/wheels/build_f3d_superbuild.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
cmake -S ./source -B ./fsbb \
33
-DBUILD_SHARED_LIBS=OFF \
44
-DCMAKE_BUILD_TYPE=Release \
5-
-DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 \
5+
-DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 \
66
-DENABLE_f3d=OFF \
77
-DENABLE_alembic=ON \
88
-DENABLE_assimp=ON \

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ function (superbuild_find_projects var)
6363
tbb
6464
vtk
6565
webp
66+
webifc
6667
xz
6768
zstd
6869
zlib)
@@ -144,6 +145,7 @@ set(_superbuild_default_ospray ON)
144145
set(_superbuild_default_pybind11 OFF)
145146
set(_superbuild_default_tbb ON)
146147
set(_superbuild_default_webp ON)
148+
set(_superbuild_default_webifc ON)
147149

148150
if (NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/superbuild/CMakeLists.txt")
149151
message(FATAL_ERROR "It appears as though the superbuild infrastructure "

projects/f3d.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ superbuild_add_project(f3d
2020
LICENSE.md
2121
THIRD_PARTY_LICENSES.md
2222
DEPENDS vtk cxx17
23-
DEPENDS_OPTIONAL pybind11 alembic assimp draco imgui occt openexr openusd openvdb webp
23+
DEPENDS_OPTIONAL pybind11 alembic assimp draco imgui occt openexr openusd openvdb webp webifc
2424
CMAKE_ARGS
2525
-DCMAKE_INSTALL_NAME_DIR:PATH=<INSTALL_DIR>/lib
2626
-DF3D_LINUX_GENERATE_MAN:BOOL=${f3d_build_for_linux}
@@ -38,6 +38,7 @@ superbuild_add_project(f3d
3838
-DF3D_PLUGIN_BUILD_OCCT:BOOL=${occt_enabled}
3939
-DF3D_PLUGIN_BUILD_USD:BOOL=${openusd_enabled}
4040
-DF3D_PLUGIN_BUILD_VDB:BOOL=${openvdb_enabled}
41+
-DF3D_PLUGIN_BUILD_WEBIFC:BOOL=${webifc_enabled}
4142
-DF3D_BINDINGS_C:BOOL=ON
4243
-DF3D_BINDINGS_PYTHON:BOOL=${f3d_build_python_bindings}
4344
-DF3D_BINDINGS_PYTHON_GENERATE_STUBS:BOOL=${f3d_build_python_bindings}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
diff --git a/src/cpp/web-ifc/geometry/IfcGeometryLoader.cpp b/src/cpp/web-ifc/geometry/IfcGeometryLoader.cpp
2+
index ebfaf3f2..13ef5d50 100644
3+
--- a/src/cpp/web-ifc/geometry/IfcGeometryLoader.cpp
4+
+++ b/src/cpp/web-ifc/geometry/IfcGeometryLoader.cpp
5+
@@ -4,6 +4,7 @@
6+
7+
#include <spdlog/spdlog.h>
8+
#include <iomanip>
9+
+#include <sstream>
10+
#include "IfcGeometryLoader.h"
11+
#include "operations/curve-utils.h"
12+
#include "operations/geometryutils.h"
13+
diff --git a/src/cpp/web-ifc/parsing/IfcLoader.cpp b/src/cpp/web-ifc/parsing/IfcLoader.cpp
14+
index ae592775..4cb54410 100644
15+
--- a/src/cpp/web-ifc/parsing/IfcLoader.cpp
16+
+++ b/src/cpp/web-ifc/parsing/IfcLoader.cpp
17+
@@ -6,7 +6,8 @@
18+
#include <string>
19+
#include <cmath>
20+
#include <algorithm>
21+
-#include <format>
22+
+#include <charconv>
23+
+#include <array>
24+
#include <fast_float/fast_float.h>
25+
#include <spdlog/spdlog.h>
26+
#include "IfcLoader.h"
27+
@@ -354,7 +355,9 @@ namespace webifc::parsing {
28+
29+
void IfcLoader::PushDouble(double input)
30+
{
31+
- std::string numberString = std::format("{}", input);
32+
+ std::array<char, 64> buf;
33+
+ auto [ptr, ec] = std::to_chars(buf.data(), buf.data() + buf.size(), input);
34+
+ std::string numberString(buf.data(), ptr);
35+
size_t eLoc = numberString.find_first_of('e');
36+
if (eLoc != std::string::npos) numberString[eLoc]='E';
37+
else if (std::floor(input) == input) numberString+='.';

projects/webifc.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
superbuild_add_project(webifc
2+
BUILD_SHARED_LIBS_INDEPENDENT
3+
LICENSE_FILES
4+
LICENSE.md
5+
SOURCE_SUBDIR src/cpp
6+
CMAKE_ARGS
7+
-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON)
8+
9+
superbuild_apply_patch(webifc remove-std-format
10+
"Replace std::format with std::to_chars for compiler compatibility")

versions.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ superbuild_set_revision(webp
4444
DOWNLOAD_NAME webp-v1.6.0.tar.gz
4545
URL_MD5 d498caf9323a24ce3ed40b84c22a32cd)
4646

47+
superbuild_set_revision(webifc
48+
URL "https://github.com/ThatOpen/engine_web-ifc/archive/refs/tags/0.75.tar.gz"
49+
DOWNLOAD_NAME webifc-0.75.tar.gz
50+
URL_MD5 a75eb5132f58eeaa4db799cc085589c4)
51+
4752
superbuild_set_selectable_source(vtk
4853
SELECT 9.5.2 DEFAULT
4954
URL "https://www.vtk.org/files/release/9.5/VTK-9.5.2.tar.gz"

0 commit comments

Comments
 (0)