Skip to content

Commit b40a0a2

Browse files
committed
Removed H5 dependency
1 parent e0309f3 commit b40a0a2

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

CMakeLists.txt

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,14 @@ if (RENDER_TEXTURE)
5050
endif()
5151

5252
# # Add highfive library
53-
find_package(HDF5 REQUIRED)
54-
include(highfive)
55-
add_library(HighFiveLib INTERFACE)
56-
target_include_directories(HighFiveLib SYSTEM INTERFACE ${highfive_SOURCE_DIR}/include/ ${HDF5_INCLUDE_DIRS})
57-
target_link_libraries(HighFiveLib INTERFACE ${HDF5_LIBRARIES})
53+
if (USE_HIGHFIVE)
54+
find_package(HDF5 REQUIRED)
55+
include(highfive)
56+
add_library(HighFiveLib INTERFACE)
57+
target_include_directories(HighFiveLib SYSTEM INTERFACE ${highfive_SOURCE_DIR}/include/ ${HDF5_INCLUDE_DIRS})
58+
target_link_libraries(HighFiveLib INTERFACE ${HDF5_LIBRARIES})
59+
add_compile_definitions(USE_HIGHFIVE)
60+
endif()
5861

5962
# Set compile definitions
6063
if(USE_PYBIND)
@@ -128,9 +131,14 @@ if(USE_PYBIND)
128131
# Link libraries
129132
target_link_libraries(optimization_py PUBLIC
130133
MetricOptimizationLib
131-
HighFiveLib
132134
)
133135

136+
if(USE_HIGHFIVE)
137+
target_link_libraries(optimization_py PUBLIC
138+
HighFiveLib
139+
)
140+
endif()
141+
134142
if(USE_SUITESPARSE)
135143
include(suitesparse)
136144
target_link_libraries(MetricOptimizationLib PRIVATE

src/optimization/optimization_pybind.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@
5252
#include "shapes.hh"
5353
#include "shear.hh"
5454
#include "translation.hh"
55+
56+
#ifdef USE_HIGHFIVE
5557
#include <highfive/H5Easy.hpp>
58+
#endif
5659

5760
#ifdef RENDER_TEXTURE
5861
#include "conformal_ideal_delaunay/Sampling.hh"
@@ -394,6 +397,7 @@ init_parameterization_pybind(pybind11::module& m)
394397
pybind11::scoped_estream_redirect>());
395398
}
396399

400+
#ifdef USE_HIGHFIVE
397401
void save_simplify_overlay_input(std::string fname,
398402
std::vector<std::pair<int,int>> endpoints,
399403
Eigen::MatrixXd V,
@@ -451,7 +455,7 @@ load_simplify_overlay_output(
451455

452456
return std::make_tuple(endpoints, V, F, uv, Fuv, cut_type, Vn_to_V);
453457
}
454-
458+
#endif
455459

456460

457461
// wrap as Python module
@@ -466,6 +470,7 @@ PYBIND11_MODULE(optimization_py, m)
466470
init_optimization_pybind(m);
467471
init_parameterization_pybind(m);
468472

473+
#ifdef USE_HIGHFIVE
469474
m.def("save_simplify_overlay_input",
470475
&save_simplify_overlay_input,
471476
"Save simplify overlay mesh input to file",
@@ -476,6 +481,8 @@ PYBIND11_MODULE(optimization_py, m)
476481
"Load simplify overlay mesh output from file",
477482
pybind11::call_guard<pybind11::scoped_ostream_redirect,
478483
pybind11::scoped_estream_redirect>());
484+
#endif
485+
479486
m.def("write_obj_with_uv",
480487
&write_obj_with_uv,
481488
"Write obj file with uv coordinates",

0 commit comments

Comments
 (0)