Skip to content

[meshlib] add new port#50196

Draft
toge wants to merge 35 commits intomicrosoft:masterfrom
toge:meshlib-add
Draft

[meshlib] add new port#50196
toge wants to merge 35 commits intomicrosoft:masterfrom
toge:meshlib-add

Conversation

@toge
Copy link
Copy Markdown
Contributor

@toge toge commented Feb 27, 2026

  • Changes comply with the maintainer guide.
  • The packaged project shows strong association with the chosen port name. Check this box if at least one of the following criteria is met:
    • The project is in Repology: https://repology.org//versions
    • The project is amongst the first web search results for "" or " C++". Include a screenshot of the search engine results in the PR.
    • The port name follows the 'GitHubOrg-GitHubRepo' form or equivalent Owner-Project form.
  • Optional dependencies of the build are all controlled by the port. A dependency is controlled if it is declared an unconditional dependency in vcpkg.json, or explicitly disabled through patches or build system arguments such as CMAKE_DISABLE_FIND_PACKAGE_Xxx or VCPKG_LOCK_FIND_PACKAGE
  • The versioning scheme in vcpkg.json matches what upstream says.
  • The license declaration in vcpkg.json matches what upstream says.
  • The installed as the "copyright" file matches what upstream says.
  • The source code of the component installed comes from an authoritative source.
  • The generated "usage text" is brief and accurate. See adding-usage for context. Don't add a usage file if the automatically generated usage is correct.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Exactly one version is added in each modified versions file.

https://meshlib.io/
https://github.com/MeshInspector/MeshLib

@toge toge marked this pull request as draft February 27, 2026 15:55
@toge toge marked this pull request as ready for review March 9, 2026 23:53
IF(MSVC)
add_definitions(-DUNICODE -D_UNICODE)
- add_definitions(-D_ITERATOR_DEBUG_LEVEL=0)
+ add_definitions(-D_ITERATOR_DEBUG_LEVEL=$<IF:$<CONFIG:Debug>,2,0>)
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.

Suggested change
+ add_definitions(-D_ITERATOR_DEBUG_LEVEL=$<IF:$<CONFIG:Debug>,2,0>)

This is the default.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@BillyONeal
Thanks!
Fixed.


IF(MSVC)
- add_subdirectory(${PROJECT_SOURCE_DIR}/laz-perf)
add_subdirectory(${PROJECT_SOURCE_DIR}/OpenCTM)
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.

This line is also removed by disable-openctm; should these patches be merged?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@BillyONeal
I merged these patches to devendoring.patch.

Comment thread ports/meshlib/portfile.cmake Outdated
-DMESHLIB_BUILD_MESHVIEWER=OFF
-DMESHLIB_BUILD_MRVIEWER=OFF
-DMESHLIB_BUILD_PYTHON_MODULES=OFF
-DMESHLIB_USE_VCPKG=ON
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.

There should be a comment describing how this does not do vcpkg-in-vcpkg

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@BillyONeal
Fixed.


vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
DISABLE_PARALLEL_CONFIGURE
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.

Can you speak to the failure that caused you to add this? Do the installed contents have correct release/debug settings in their build system bindings?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is needed to solve "No such file or directory" error:
https://github.com/MeshInspector/MeshLib/blob/master/source/MRMesh/CMakeLists.txt#L19

CMake Error at source/MRMesh/CMakeLists.txt:19 (configure_file):
  No such file or directory

Comment thread ports/meshlib/portfile.cmake Outdated
"${CURRENT_PACKAGES_DIR}/debug/include"
)
if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin"
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.

Did it build DLLs even though you asked for static or did something else happen? (I'm concerned that this reports "success" on the static targets but actually ends up installing nothing or something to that effect...)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@BillyONeal
Sorry, it's my mistake.
Meshlib is dynamic library.
I forced to always build dynamic library.

Comment thread ports/meshlib/disable-openctm.patch Outdated
-add_subdirectory(./OpenCTM-git ./OpenCTM)

option(PHMAP_INSTALL "" ON)
add_subdirectory(./parallel-hashmap)
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.

This seems also wrong given the parallel-hashmap dependency?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@BillyONeal
Fixed.

PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
+ $<INSTALL_INTERFACE:${MR_INCLUDE_DIR}>
$<BUILD_INTERFACE:${MESHLIB_THIRDPARTY_DIR}/parallel-hashmap>
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.

Probably needs to use the header path from the port rather than the third party directory?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@BillyONeal
Thanks!
Fixed.

PATCHES
lazperf-cpp17.patch
)
file(REMOVE_RECURSE "${SOURCE_PATH}/thirdparty/laz-perf")
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.

Should the entire thirdparty directory be deleted?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@BillyONeal
I need thirdparty/CMakeLists.txt which call find_package to find dependencies.

@toge toge marked this pull request as draft March 10, 2026 01:24
@toge toge marked this pull request as ready for review March 16, 2026 14:23
@vicroms vicroms closed this Mar 19, 2026
@vicroms vicroms reopened this Mar 19, 2026
Copy link
Copy Markdown
Member

@vicroms vicroms left a comment

Choose a reason for hiding this comment

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

I have a few questions about this port. Not requesting any changes yet.

Comment on lines +9 to +10
-IF(MESHLIB_USE_VCPKG)
+IF(TRUE)
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
)

Comment on lines +9 to +11
+IF(MESHLIB_BUILD_EXTRA_IO_FORMATS)
+ add_subdirectory(${PROJECT_SOURCE_DIR}/laz-perf)
+ENDIF()
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?

-DMESHLIB_BUILD_MESHVIEWER=OFF
-DMESHLIB_BUILD_MRVIEWER=OFF
-DMESHLIB_BUILD_PYTHON_MODULES=OFF
-DMESHLIB_USE_VCPKG=OFF
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 is this disabled? If upstream's build system is already vcpkg-aware they might be willing to take some of the patches made in this PR.

vcpkg_cmake_install()

vcpkg_fixup_pkgconfig()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/MeshLib)
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.

we introduced a bunch of find_package that might be missing corresponding find_dependency calls

@vicroms vicroms marked this pull request as draft March 19, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants