Skip to content

Commit

Permalink
[libigl] Update to v2.5.0 (#34703)
Browse files Browse the repository at this point in the history
* [libigl] Upate to v2.5.0

* Add updated patches to libigl v2.5.0

* Add find_package for stb

* Remove PNG from libigl

* Update basline.json and libigl.json

* Update libigl.json

* Add stb to dependancies, remove unneeded patch

* Fix formating

* Update libigl.json version

* Stb is case senstive on Linux

* Update version git-tree
  • Loading branch information
NewWheelTech authored Oct 28, 2023
1 parent 1c00eae commit 9ffbe67
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 105 deletions.
45 changes: 4 additions & 41 deletions ports/libigl/dependencies.patch
Original file line number Diff line number Diff line change
@@ -1,29 +1,3 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 232bc03..8143963 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -64,7 +64,7 @@ set(MATLAB_ADDITIONAL_VERSIONS
set(LIBIGL_DEFAULT_MATLAB ${LIBIGL_TOPLEVEL_PROJECT})
set(LIBIGL_DEFAULT_MOSEK ${LIBIGL_TOPLEVEL_PROJECT})
if(LIBIGL_TOPLEVEL_PROJECT)
- if(NOT WIN32)
+ if(0)
find_package(GMP QUIET)
find_package(MPFR QUIET)
if(NOT (TARGET gmp::gmp AND TARGET mpfr::mpfr))
diff --git a/cmake/igl/libigl-config.cmake.in b/cmake/igl/libigl-config.cmake.in
index 359e314..6e04af6 100644
--- a/cmake/igl/libigl-config.cmake.in
+++ b/cmake/igl/libigl-config.cmake.in
@@ -1,3 +1,8 @@
@PACKAGE_INIT@

+include(CMakeFindDependencyMacro)
+find_dependency(Eigen3)
+find_dependency(Threads)
+include("${CMAKE_CURRENT_LIST_DIR}/LibiglConfigTargets.cmake")
+
check_required_components(Libigl)
diff --git a/cmake/igl/modules/copyleft/cgal.cmake b/cmake/igl/modules/copyleft/cgal.cmake
index f6abe8c..7ee7d84 100644
--- a/cmake/igl/modules/copyleft/cgal.cmake
Expand Down Expand Up @@ -74,10 +48,10 @@ index 6f22319..de85066 100644

# 5. Unit tests
diff --git a/cmake/igl/modules/glfw.cmake b/cmake/igl/modules/glfw.cmake
index 151338e..f42d22a 100644
index 79c2126..6d06775 100644
--- a/cmake/igl/modules/glfw.cmake
+++ b/cmake/igl/modules/glfw.cmake
@@ -14,10 +14,10 @@ file(GLOB SRC_FILES "${libigl_SOURCE_DIR}/include/igl/opengl/glfw/*.cpp")
@@ -14,12 +14,12 @@ file(GLOB SRC_FILES "${libigl_SOURCE_DIR}/include/igl/opengl/glfw/*.cpp")
igl_target_sources(igl_glfw ${INC_FILES} ${SRC_FILES})

# 4. Dependencies
Expand All @@ -90,6 +64,8 @@ index 151338e..f42d22a 100644
- glfw::glfw
+ $<TARGET_NAME:glfw>
)

# 5. Unit tests
diff --git a/cmake/igl/modules/imgui.cmake b/cmake/igl/modules/imgui.cmake
index d7ffb9d..f331854 100644
--- a/cmake/igl/modules/imgui.cmake
Expand Down Expand Up @@ -124,19 +100,6 @@ index 4580c03..dfadb38 100644
find_package(OpenGL REQUIRED OPTIONAL_COMPONENTS OpenGL)
target_link_libraries(igl_opengl ${IGL_SCOPE}
igl::core
diff --git a/cmake/igl/modules/png.cmake b/cmake/igl/modules/png.cmake
index b267deb..8d8decc 100644
--- a/cmake/igl/modules/png.cmake
+++ b/cmake/igl/modules/png.cmake
@@ -14,7 +14,7 @@ file(GLOB SRC_FILES "${libigl_SOURCE_DIR}/include/igl/png/*.cpp")
igl_target_sources(igl_png ${INC_FILES} ${SRC_FILES})

# 4. Dependencies
-include(stb)
+find_package(Stb REQUIRED)
igl_include(opengl)
target_link_libraries(igl_png ${IGL_SCOPE}
igl::core
diff --git a/cmake/igl/modules/xml.cmake b/cmake/igl/modules/xml.cmake
index 3763b77..31ab979 100644
--- a/cmake/igl/modules/xml.cmake
Expand Down
64 changes: 35 additions & 29 deletions ports/libigl/install-extra-targets.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8143963..784ac50 100644
index 4a98749..bc121a5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -157,7 +157,7 @@ if(LIBIGL_INSTALL)
@@ -166,7 +166,7 @@ if(LIBIGL_INSTALL)
set(version_config_file "${CMAKE_CURRENT_BINARY_DIR}/LibiglConfigVersion.cmake")
set(export_dest_dir "${CMAKE_INSTALL_LIBDIR}/cmake/igl")

Expand All @@ -12,12 +12,12 @@ index 8143963..784ac50 100644
DESTINATION ${export_dest_dir}
NAMESPACE igl${suffix}::
diff --git a/cmake/igl/libigl-config.cmake.in b/cmake/igl/libigl-config.cmake.in
index 629896d..0b05692 100644
index d3ff19f..60e50c7 100644
--- a/cmake/igl/libigl-config.cmake.in
+++ b/cmake/igl/libigl-config.cmake.in
@@ -4,5 +4,30 @@ include(CMakeFindDependencyMacro)
find_dependency(Eigen3)
find_dependency(Threads)
@@ -4,4 +4,27 @@ include(CMakeFindDependencyMacro)
find_dependency(Eigen3 REQUIRED)
find_dependency(Threads REQUIRED)
include("${CMAKE_CURRENT_LIST_DIR}/LibiglConfigTargets.cmake")
+if(TARGET igl::igl_embree)
+ find_dependency(embree 3)
Expand All @@ -33,9 +33,6 @@ index 629896d..0b05692 100644
+ find_dependency(OpenGL)
+ find_dependency(glad)
+endif()
+if(TARGET igl::igl_png)
+ find_dependency(Stb)
+endif()
+if(TARGET igl::igl_xml)
+ find_dependency(tinyxml2)
+endif()
Expand All @@ -44,7 +41,7 @@ index 629896d..0b05692 100644
+if(TARGET igl_copyleft::igl_copyleft_cgal)
+ find_dependency(CGAL)
+endif()
+
check_required_components(Libigl)
diff --git a/cmake/igl/modules/copyleft/cgal.cmake b/cmake/igl/modules/copyleft/cgal.cmake
index 7ee7d84..d06c6ee 100644
Expand Down Expand Up @@ -99,10 +96,10 @@ index 137d30b..597c26b 100644

# 4. Install target & headers
diff --git a/cmake/igl/modules/embree.cmake b/cmake/igl/modules/embree.cmake
index de85066..052fc76 100644
index de85066..c54949c 100644
--- a/cmake/igl/modules/embree.cmake
+++ b/cmake/igl/modules/embree.cmake
@@ -20,6 +20,9 @@ target_link_libraries(igl_embree ${IGL_SCOPE}
@@ -20,6 +20,8 @@ target_link_libraries(igl_embree ${IGL_SCOPE}
$<TARGET_NAME:embree>
)

Expand All @@ -111,47 +108,42 @@ index de85066..052fc76 100644
# 5. Unit tests
file(GLOB SRC_FILES "${libigl_SOURCE_DIR}/tests/include/igl/embree/*.cpp")
igl_add_test(igl_embree ${SRC_FILES})
+
diff --git a/cmake/igl/modules/glfw.cmake b/cmake/igl/modules/glfw.cmake
index f42d22a..e9930d8 100644
index 6d06775..7126a23 100644
--- a/cmake/igl/modules/glfw.cmake
+++ b/cmake/igl/modules/glfw.cmake
@@ -21,3 +21,5 @@ target_link_libraries(igl_glfw ${IGL_SCOPE}
igl::opengl
@@ -22,6 +22,9 @@ target_link_libraries(igl_glfw ${IGL_SCOPE}
$<TARGET_NAME:glfw>
)

+
+igl_install(igl_glfw ${INC_FILES} ${SRC_FILES})
+
# 5. Unit tests
if(LIBIGL_GLFW_TESTS)
file(GLOB SRC_FILES "${libigl_SOURCE_DIR}/tests/include/igl/opengl/glfw/*.cpp")
diff --git a/cmake/igl/modules/imgui.cmake b/cmake/igl/modules/imgui.cmake
index f331854..7ff9738 100644
index f331854..6e0de4c 100644
--- a/cmake/igl/modules/imgui.cmake
+++ b/cmake/igl/modules/imgui.cmake
@@ -23,3 +23,5 @@ target_link_libraries(igl_imgui ${IGL_SCOPE}
@@ -23,3 +23,6 @@ target_link_libraries(igl_imgui ${IGL_SCOPE}
imgui::imgui
imguizmo::imguizmo
)
+
+igl_install(igl_imgui ${INC_FILES} ${SRC_FILES})
+
diff --git a/cmake/igl/modules/opengl.cmake b/cmake/igl/modules/opengl.cmake
index dfadb38..185494b 100644
index dfadb38..d3deaba 100644
--- a/cmake/igl/modules/opengl.cmake
+++ b/cmake/igl/modules/opengl.cmake
@@ -22,3 +22,5 @@ target_link_libraries(igl_opengl ${IGL_SCOPE}
@@ -22,3 +22,6 @@ target_link_libraries(igl_opengl ${IGL_SCOPE}
# Link against OpenGL::OpenGL if available, or fallback to OpenGL::GL
$<IF:$<TARGET_EXISTS:OpenGL::OpenGL>,OpenGL::OpenGL,OpenGL::GL>
)
+
+igl_install(igl_opengl ${INC_FILES} ${SRC_FILES})
diff --git a/cmake/igl/modules/png.cmake b/cmake/igl/modules/png.cmake
index 8d8decc..293da91 100644
--- a/cmake/igl/modules/png.cmake
+++ b/cmake/igl/modules/png.cmake
@@ -21,3 +21,5 @@ target_link_libraries(igl_png ${IGL_SCOPE}
igl::opengl
stb::stb
)
+
+igl_install(igl_png ${INC_FILES} ${SRC_FILES})
diff --git a/cmake/igl/modules/xml.cmake b/cmake/igl/modules/xml.cmake
index 31ab979..815ea62 100644
--- a/cmake/igl/modules/xml.cmake
Expand All @@ -162,3 +154,17 @@ index 31ab979..815ea62 100644
)
+
+igl_install(igl_xml ${INC_FILES} ${SRC_FILES})

diff --git a/cmake/igl/modules/stb.cmake b/cmake/igl/modules/stb.cmake
index 20607ec..5bc3211 100644
--- a/cmake/igl/modules/stb.cmake
+++ b/cmake/igl/modules/stb.cmake
@@ -21,7 +21,7 @@ endif()
igl_target_sources(igl_stb ${INC_FILES} ${SRC_FILES})

# 4. Dependencies
-include(stb)
+find_package(Stb REQUIRED)
target_link_libraries(igl_stb ${IGL_SCOPE}
igl::core
stb::stb
8 changes: 4 additions & 4 deletions ports/libigl/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libigl/libigl
REF 66b3ef2253e765d0ce0db74cec91bd706e5ba176 #2.4.0
SHA512 7014ffdaa160bfa2509fc283cb7176d7994a37f51509c7374659292efad076c8fb594f9f6990bab1aa5562d1f66e93403ea35a5bf2a924436560a2d4669ffcfd
REF fdaac01bcc52888994f7afd029dcc045dd408484 #2.5.0
SHA512 214f6af92026987d9ee3bad5e1849ef96d8455b1de38a03d068b7d7ab88b66a08f3a1f7c11b0cabc8d0744c19855ee2fdd544ac15ad826d117ef1ba97a318a2f
HEAD_REF master
PATCHES
dependencies.patch
upstream_fixes.patch
install-extra-targets.patch
)
file(REMOVE
Expand All @@ -27,6 +26,7 @@ file(REMOVE
"${SOURCE_PATH}/cmake/recipes/external/mpfr.cmake"
"${SOURCE_PATH}/cmake/recipes/external/stb.cmake"
"${SOURCE_PATH}/cmake/recipes/external/tinyxml2.cmake"
"${SOURCE_PATH}/cmake/recipes/external/spectra.cmake"
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
Expand All @@ -36,7 +36,6 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
glfw LIBIGL_GLFW
imgui LIBIGL_IMGUI
opengl LIBIGL_OPENGL
png LIBIGL_PNG
xml LIBIGL_XML
# Features removed: missing binary libs / separate ports
comiso LIBIGL_COPYLEFT_COMISO
Expand All @@ -58,6 +57,7 @@ vcpkg_cmake_configure(
-DLIBIGL_RESTRICTED_MOSEK=OFF
-DLIBIGL_USE_STATIC_LIBRARY=OFF
-DHUNTER_ENABLED=OFF
-DLIBIGL_SPECTRA=OFF
${ADDITIONAL_OPTIONS}
)

Expand Down
14 changes: 0 additions & 14 deletions ports/libigl/upstream_fixes.patch

This file was deleted.

17 changes: 2 additions & 15 deletions ports/libigl/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "libigl",
"version": "2.4.0",
"port-version": 4,
"version": "2.5.0",
"description": "libigl is a simple C++ geometry processing library. We have a wide functionality including construction of sparse discrete differential geometry operators and finite-elements matrices such as the cotangent Laplacian and diagonalized mass matrix, simple facet and edge-based topology data structures, mesh-viewing utilities for OpenGL and GLSL, and many core functions for matrix manipulation which make Eigen feel a lot more like MATLAB.",
"homepage": "https://github.com/libigl/libigl",
"license": null,
"dependencies": [
"eigen3",
"stb",
{
"name": "vcpkg-cmake",
"host": true
Expand Down Expand Up @@ -77,19 +77,6 @@
"opengl"
]
},
"png": {
"description": "Install PNG support",
"dependencies": [
{
"name": "libigl",
"default-features": false,
"features": [
"opengl"
]
},
"stb"
]
},
"xml": {
"description": "Build with libxml",
"dependencies": [
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4325,8 +4325,8 @@
"port-version": 3
},
"libigl": {
"baseline": "2.4.0",
"port-version": 4
"baseline": "2.5.0",
"port-version": 0
},
"libilbc": {
"baseline": "3.0.4",
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/libigl.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e9b48cd75312e9e77df2c2e7307b063d8737f4ba",
"version": "2.5.0",
"port-version": 0
},
{
"git-tree": "260c09078445cfce5ce800b1d3cfa47877f6f783",
"version": "2.4.0",
Expand Down

0 comments on commit 9ffbe67

Please sign in to comment.