-
Notifications
You must be signed in to change notification settings - Fork 7.5k
[meshlib] add new port #50196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
toge
wants to merge
35
commits into
microsoft:master
Choose a base branch
from
toge:meshlib-add
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+565
−0
Draft
[meshlib] add new port #50196
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 ffe6b51
fix libjpeg-turbo link error
toge 42e7a4a
disable test, force using C++20
toge b42d761
update laz-perf
toge 4c242c3
force C++17 on lazperf
toge 5a98cdf
disable openctm
toge 370ab84
disable openctm subdirectory
toge ef10e37
disable /WX
toge 79e77ef
copy tools
toge 1f92269
update versions
toge f3bce6e
don't copy dll on static build
toge a7f6182
disable PCH
toge 53899da
support 32bit
toge afe08e3
support 32bit (more)
toge d0d895b
drop arm32 android
toge 11ee524
fix ITERATOR_DEBUG_LEVEL
toge 89a86a1
fix tinyxml2 link on msvc
toge e014cb0
fix blosc link
toge 465265c
remove bin folders in windows static build
toge 182d6c9
disable _ITERATOR_DEBUG_LEVEL
toge 37da43d
disable itetarot_debug_level check
toge f9a6f07
disable vcpkg in vcpkg
toge bc19a2e
fix install dirs
toge 96a34e2
find pkgconfig
toge 518cc56
devendoring parallel-hashmap, tinygltf
toge 53fae17
remove unused patch
toge a21934f
merge devendoring patche files
toge 574ae7d
Merge branch 'microsoft:master' into meshlib-add
toge 8a8ded9
devendoring parallel-hashmap
toge 0936d5b
update versions
toge 1f4f394
Merge branch 'meshlib-add' of https://github.com/toge/vcpkg into mesh…
toge 411096d
force shared build
toge 726187a
disable copying xerces.dlls
toge 987e73c
disable copying xerces.dlls
toge 4a947f3
remove unused patches
toge File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() | ||
| + | ||
| 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 "") | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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` !! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? |
||
| # use OS-agnostic directory structure for vcpkg | ||
| set(MR_BIN_DIR bin) | ||
| set(MR_INCLUDE_DIR include/MeshLib) | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vendored laz-perf?