HDF5 optional in code

This commit is contained in:
Thomas Krijnen
2021-08-31 11:03:28 +02:00
parent dbf6a1dda9
commit 66faea1285
4 changed files with 21 additions and 8 deletions
+10 -8
View File
@@ -437,7 +437,7 @@ if(HDF5_SUPPORT)
set(lib_ext a)
endif()
SET(HDF5_LIBRARIES
SET(HDF5_LIBRARIES
"${HDF5_LIBRARY_DIR}/libhdf5_cpp.${lib_ext}"
"${HDF5_LIBRARY_DIR}/libhdf5.${lib_ext}"
"${HDF5_LIBRARY_DIR}/libz${zlib_post}.${lib_ext}"
@@ -449,14 +449,16 @@ if(HDF5_SUPPORT)
if (NOT HDF5_LIBRARIES)
# debian default
SET(HDF5_LIBRARIES
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5_cpp.a
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.a
/usr/lib/x86_64-linux-gnu/libsz.a
/usr/lib/x86_64-linux-gnu/libaec.a
z dl
)
SET(HDF5_LIBRARIES
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5_cpp.a
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.a
/usr/lib/x86_64-linux-gnu/libsz.a
/usr/lib/x86_64-linux-gnu/libaec.a
z dl
)
endif()
add_definitions(-DWITH_HDF5)
endif()
IF(NOT CMAKE_BUILD_TYPE)
+4
View File
@@ -105,7 +105,9 @@ void print_usage(bool suggest_help = true)
<< " .igs IGES Initial Graphics Exchange Specification\n"
<< " .xml XML Property definitions and decomposition tree\n"
<< " .svg SVG Scalable Vector Graphics (2D floor plan)\n"
#ifdef WITH_HDF5
<< " .h5 HDF Hierarchical Data Format storing positions, normals and indices\n"
#endif
<< " .ifc IFC-SPF Industry Foundation Classes\n"
<< "\n"
<< "If no output filename given, <input>" << IfcUtil::path::from_utf8(DEFAULT_EXTENSION) << " will be used as the output file.\n";
@@ -834,10 +836,12 @@ int main(int argc, char** argv) {
settings.set(IfcGeom::IteratorSettings::DISABLE_TRIANGULATION, true);
serializer = boost::make_shared<SvgSerializer>(IfcUtil::path::to_utf8(output_temp_filename), settings);
}
#ifdef WITH_HDF5
else if (output_extension == HDF) {
settings.set(IfcGeom::IteratorSettings::DISABLE_TRIANGULATION, true);
serializer = boost::make_shared<HdfSerializer>(IfcUtil::path::to_utf8(output_temp_filename), settings);
}
#endif
else {
cerr_ << "[Error] Unknown output filename extension '" << output_extension << "'\n";
+3
View File
@@ -17,6 +17,7 @@
* *
********************************************************************************/
#ifdef WITH_HDF5
#include "HdfSerializer.h"
@@ -125,3 +126,5 @@ void HdfSerializer::write(const IfcGeom::BRepElement* o) {
}
}
#endif
+4
View File
@@ -20,6 +20,8 @@
#ifndef HdfSERIALIZER_H
#define HdfSERIALIZER_H
#ifdef WITH_HDF5
#include <set>
#include <string>
#include <fstream>
@@ -55,3 +57,5 @@ public:
};
#endif
#endif