Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
4b978b5
[meshlib] add new port
toge Feb 27, 2026
ffe6b51
fix libjpeg-turbo link error
toge Feb 27, 2026
42e7a4a
disable test, force using C++20
toge Feb 27, 2026
b42d761
update laz-perf
toge Feb 27, 2026
4c242c3
force C++17 on lazperf
toge Feb 27, 2026
5a98cdf
disable openctm
toge Mar 1, 2026
370ab84
disable openctm subdirectory
toge Mar 1, 2026
ef10e37
disable /WX
toge Mar 2, 2026
79e77ef
copy tools
toge Mar 2, 2026
1f92269
update versions
toge Mar 2, 2026
f3bce6e
don't copy dll on static build
toge Mar 2, 2026
a7f6182
disable PCH
toge Mar 2, 2026
53899da
support 32bit
toge Mar 3, 2026
afe08e3
support 32bit (more)
toge Mar 4, 2026
d0d895b
drop arm32 android
toge Mar 8, 2026
11ee524
fix ITERATOR_DEBUG_LEVEL
toge Mar 9, 2026
89a86a1
fix tinyxml2 link on msvc
toge Mar 9, 2026
e014cb0
fix blosc link
toge Mar 9, 2026
465265c
remove bin folders in windows static build
toge Mar 9, 2026
182d6c9
disable _ITERATOR_DEBUG_LEVEL
toge Mar 10, 2026
37da43d
disable itetarot_debug_level check
toge Mar 10, 2026
f9a6f07
disable vcpkg in vcpkg
toge Mar 11, 2026
bc19a2e
fix install dirs
toge Mar 11, 2026
96a34e2
find pkgconfig
toge Mar 11, 2026
518cc56
devendoring parallel-hashmap, tinygltf
toge Mar 11, 2026
53fae17
remove unused patch
toge Mar 11, 2026
a21934f
merge devendoring patche files
toge Mar 13, 2026
574ae7d
Merge branch 'microsoft:master' into meshlib-add
toge Mar 13, 2026
8a8ded9
devendoring parallel-hashmap
toge Mar 13, 2026
0936d5b
update versions
toge Mar 13, 2026
1f4f394
Merge branch 'meshlib-add' of https://github.com/toge/vcpkg into mesh…
toge Mar 13, 2026
411096d
force shared build
toge Mar 16, 2026
726187a
disable copying xerces.dlls
toge Mar 16, 2026
987e73c
disable copying xerces.dlls
toge Mar 16, 2026
4a947f3
remove unused patches
toge Mar 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 124 additions & 0 deletions ports/meshlib/devendoring.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a1e9a49..e9751cb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -210,6 +210,10 @@ ENDIF()
add_subdirectory(${PROJECT_SOURCE_DIR}/MRPch ./MRPch)
add_subdirectory(${PROJECT_SOURCE_DIR}/MRMesh ./MRMesh)

+IF(MESHLIB_BUILD_EXTRA_IO_FORMATS)
+ add_subdirectory(${PROJECT_SOURCE_DIR}/laz-perf)
+ENDIF()
Comment on lines +9 to +11
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vendored laz-perf?

+
IF(MESHLIB_BUILD_EXTRA_IO_FORMATS)
add_subdirectory(${PROJECT_SOURCE_DIR}/MRIOExtras ./MRIOExtras)
ENDIF()
@@ -274,8 +278,6 @@ IF(MESHLIB_PYTHON_SUPPORT)
ENDIF()

IF(MSVC)
- add_subdirectory(${PROJECT_SOURCE_DIR}/laz-perf)
- add_subdirectory(${PROJECT_SOURCE_DIR}/OpenCTM)
ENDIF()

IF(NOT MR_EMSCRIPTEN)
diff --git a/source/MRIOExtras/CMakeLists.txt b/source/MRIOExtras/CMakeLists.txt
index 4ee8a4e..00c2936 100644
--- a/source/MRIOExtras/CMakeLists.txt
+++ b/source/MRIOExtras/CMakeLists.txt
@@ -33,7 +33,8 @@ target_link_libraries(${PROJECT_NAME}
)

IF(NOT MRIOEXTRAS_NO_XML)
- target_link_libraries(${PROJECT_NAME} PRIVATE tinyxml2)
+ find_package(tinyxml2 CONFIG REQUIRED)
+ target_link_libraries(${PROJECT_NAME} PRIVATE tinyxml2::tinyxml2)
ENDIF()

IF(NOT MRIOEXTRAS_NO_CTM)
@@ -44,9 +45,10 @@ IF(NOT MRIOEXTRAS_NO_CTM)
ENDIF()

IF(NOT MRIOEXTRAS_NO_E57)
+ find_package(E57Format CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE E57Format)

- IF(MSVC AND DEFINED VCPKG_INSTALLED_DIR AND DEFINED VCPKG_TARGET_TRIPLET)
+ IF(FALSE)
file(GLOB XERCES_DLL_RELEASE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin/xerces-c_3_*.dll")
file(GLOB XERCES_DLL_DEBUG "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/bin/xerces-c_3_*.dll")

@@ -72,12 +74,8 @@ IF(NOT MRIOEXTRAS_NO_E57)
ENDIF()

IF(NOT MRIOEXTRAS_NO_JPEG)
- IF(APPLE)
- target_include_directories(${PROJECT_NAME} PRIVATE $<BUILD_INTERFACE:${HOMEBREW_PREFIX}/opt/jpeg-turbo/include>) # @todo
- target_link_libraries(${PROJECT_NAME} PRIVATE ${HOMEBREW_PREFIX}/opt/jpeg-turbo/lib/libturbojpeg.dylib)
- ELSE()
- target_link_libraries(${PROJECT_NAME} PRIVATE turbojpeg)
- ENDIF()
+ find_package(libjpeg-turbo CONFIG REQUIRED)
+ target_link_libraries(${PROJECT_NAME} PRIVATE $<IF:$<TARGET_EXISTS:libjpeg-turbo::turbojpeg>,libjpeg-turbo::turbojpeg,libjpeg-turbo::turbojpeg-static>)
ENDIF()

IF(NOT MRIOEXTRAS_NO_LAS)
diff --git a/source/MRVoxels/CMakeLists.txt b/source/MRVoxels/CMakeLists.txt
index 104edb9..c4f1cf1 100644
--- a/source/MRVoxels/CMakeLists.txt
+++ b/source/MRVoxels/CMakeLists.txt
@@ -32,8 +32,9 @@ target_link_libraries(${PROJECT_NAME}
OpenVDB::openvdb
)
# required for static linking
-IF(EMSCRIPTEN)
- target_link_libraries(${PROJECT_NAME} PRIVATE blosc)
+find_package(blosc CONFIG REQUIRED)
+IF(OpenVDB_USES_BLOSC AND TARGET blosc_static)
+ target_link_libraries(${PROJECT_NAME} PRIVATE blosc_static)
ENDIF()

IF(NOT MRVOXELS_NO_DICOM)
diff --git a/source/laz-perf/CMakeLists.txt b/source/laz-perf/CMakeLists.txt
index d5ccfd4..ec7475f 100644
--- a/source/laz-perf/CMakeLists.txt
+++ b/source/laz-perf/CMakeLists.txt
@@ -1,7 +1,9 @@
# This file exists so we can disable some warnings in Lazperf.
# If we were to `add_subdirectory` it directly from `MeshLib/CMakeLists.txt`, we would have to modify the global CXX flags, which is uncool.

-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4244 /wd4245 /wd4456 /wd4458 /wd5051")
+if(MSVC)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4244 /wd4245 /wd4456 /wd4458 /wd5051")
+endif()
set(WITH_TESTS OFF CACHE BOOL "Choose if LAZPERF unit tests should be built")
set(WITH_TOOLS OFF CACHE BOOL "Choose if LAZPERF tools should be built")
add_subdirectory(${MESHLIB_THIRDPARTY_DIR}/laz-perf ./laz-perf)
diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt
index e4734cf..e1e89bd 100644
--- a/thirdparty/CMakeLists.txt
+++ b/thirdparty/CMakeLists.txt
@@ -83,10 +83,8 @@ IF(NOT APPLE AND NOT MR_EMSCRIPTEN)
ENDIF()
ENDIF()

-add_subdirectory(./OpenCTM-git ./OpenCTM)
-
-option(PHMAP_INSTALL "" ON)
-add_subdirectory(./parallel-hashmap)
+find_path(PARALLEL_HASHMAP_INCLUDE_DIRS "parallel_hashmap/btree.h")
+include_directories(${PARALLEL_HASHMAP_INCLUDE_DIRS})

IF(EMSCRIPTEN)
add_subdirectory(./expected ./expected)
@@ -162,8 +160,8 @@ IF(NOT MR_EMSCRIPTEN)
add_subdirectory(./mrbind-pybind11)
ENDIF()

-set(TINYGLTF_INSTALL ON)
-add_subdirectory(./tinygltf)
+find_path(TINYGLTF_INCLUDE_DIRS "tiny_gltf.h")
+include_directories(${TINYGLTF_INCLUDE_DIRS})

set(WITH_TESTS OFF CACHE BOOL "")
set(WITH_EMBIND OFF CACHE BOOL "")
13 changes: 13 additions & 0 deletions ports/meshlib/disable-warning-as-error.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/cmake/Modules/CompilerOptions.cmake b/cmake/Modules/CompilerOptions.cmake
index 0817b2b..644b535 100644
--- a/cmake/Modules/CompilerOptions.cmake
+++ b/cmake/Modules/CompilerOptions.cmake
@@ -39,7 +39,7 @@ IF(MSVC)
set(MESHLIB_COMMON_C_CXX_FLAGS "/utf-8 /fp:precise /permissive- /Zc:wchar_t /Zc:forScope /Zc:inline /DNOMINMAX /D_CRT_SECURE_NO_DEPRECATE")

# Vcpkg automatically adds `/external:W0`, but we duplicate it here because it somehow doesn't propagate to Lazperf.
- set(MESHLIB_COMMON_C_CXX_FLAGS "${MESHLIB_COMMON_C_CXX_FLAGS} /W4 /WX /external:W0 /external:env:INCLUDE")
+ set(MESHLIB_COMMON_C_CXX_FLAGS "${MESHLIB_COMMON_C_CXX_FLAGS} /W4 /external:W0 /external:env:INCLUDE")

# Following warnings are silenced:
# !! NOTE: Sync this list with `common.props` !!
13 changes: 13 additions & 0 deletions ports/meshlib/fix-cassert.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/source/MRMesh/MRBestFitPolynomial.cpp b/source/MRMesh/MRBestFitPolynomial.cpp
--- a/source/MRMesh/MRBestFitPolynomial.cpp
+++ b/source/MRMesh/MRBestFitPolynomial.cpp
@@ -1,8 +1,9 @@
#include "MRBestFitPolynomial.h"
#include "MRGTest.h"

#include <MRPch/MREigenCore.h>
#include <Eigen/LU>

+#include <cassert>
#include <cmath>
#include <complex>
64 changes: 64 additions & 0 deletions ports/meshlib/fix-exported-include-dirs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
diff --git a/source/MRMesh/CMakeLists.txt b/source/MRMesh/CMakeLists.txt
--- a/source/MRMesh/CMakeLists.txt
+++ b/source/MRMesh/CMakeLists.txt
@@ -66,6 +66,7 @@ target_link_libraries(${PROJECT_NAME} PRIVATE libzip::zip)
# TODO: CMake config
target_include_directories(${PROJECT_NAME}
PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
+ $<INSTALL_INTERFACE:${MR_INCLUDE_DIR}>
- $<BUILD_INTERFACE:${MESHLIB_THIRDPARTY_DIR}/parallel-hashmap>
)

IF(APPLE)
# for Boost.Stacktrace
target_compile_definitions(${PROJECT_NAME} PUBLIC _GNU_SOURCE)
diff --git a/source/MRIOExtras/CMakeLists.txt b/source/MRIOExtras/CMakeLists.txt
--- a/source/MRIOExtras/CMakeLists.txt
+++ b/source/MRIOExtras/CMakeLists.txt
@@ -24,6 +24,12 @@ add_library(${PROJECT_NAME} SHARED ${SOURCES} ${HEADERS})

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config_cmake.h.in ${CMAKE_CURRENT_SOURCE_DIR}/config_cmake.h)

+target_include_directories(${PROJECT_NAME}
+ PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
+ $<INSTALL_INTERFACE:${MR_INCLUDE_DIR}>
+ )
+
target_link_libraries(${PROJECT_NAME}
PUBLIC
MRMesh
diff --git a/source/MRVoxels/CMakeLists.txt b/source/MRVoxels/CMakeLists.txt
--- a/source/MRVoxels/CMakeLists.txt
+++ b/source/MRVoxels/CMakeLists.txt
@@ -25,6 +25,12 @@ target_link_libraries(${PROJECT_NAME}
PUBLIC
MRMesh
OpenVDB::openvdb
)
+
+target_include_directories(${PROJECT_NAME}
+ PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
+ $<INSTALL_INTERFACE:${MR_INCLUDE_DIR}>
+)
# required for static linking
find_package(blosc CONFIG REQUIRED)
diff --git a/source/MRSymbolMesh/CMakeLists.txt b/source/MRSymbolMesh/CMakeLists.txt
--- a/source/MRSymbolMesh/CMakeLists.txt
+++ b/source/MRSymbolMesh/CMakeLists.txt
@@ -15,6 +15,12 @@ target_link_libraries(${PROJECT_NAME}
MRMesh
PRIVATE
Freetype::Freetype
)
+
+target_include_directories(${PROJECT_NAME}
+ PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
+ $<INSTALL_INTERFACE:${MR_INCLUDE_DIR}>
+ )

install(
TARGETS ${PROJECT_NAME}
13 changes: 13 additions & 0 deletions ports/meshlib/fix-install-dirs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e9751cb..3cfd976 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -161,7 +161,7 @@ ENDIF()
message("version: ${MESHLIB_VERSION}")

set(MESHLIB_LIB_SUBDIR "${MESHLIB_PROJECT_NAME}" CACHE STRING "Subdirectory in the library directory to place the MeshLib libraries at")
-IF(MESHLIB_USE_VCPKG)
+IF(TRUE)
Comment on lines +9 to +10
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not set this in the vcpkg_cmake_configure call? Why is this option explicitly disabled in the portfile?

vcpkg_cmake_configure(...
  -DMESHLIB_USE_VCPKG=OFF
)

# use OS-agnostic directory structure for vcpkg
set(MR_BIN_DIR bin)
set(MR_INCLUDE_DIR include/MeshLib)
Loading
Loading