Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion 3rdparty/find_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,12 @@ if(WITH_MINIZIP)
open3d_pkg_config_3rdparty_library(3rdparty_minizip
SEARCH_ARGS minizip
)
list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM Open3D::3rdparty_minizip)
if(3rdparty_minizip_FOUND)
list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM Open3D::3rdparty_minizip)
else()
message(WARNING "Minizip no found. Support will be disabled.")
set(WITH_MINIZIP OFF)
endif()
endif()

# Googletest
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ else()
endif()

option(PREFER_OSX_HOMEBREW "Prefer Homebrew libs over frameworks" ON )
option(WITH_MINIZIP "Enable MiniZIP" OFF)
option(WITH_MINIZIP "Enable MiniZIP" ON )

# Sensor options
option(BUILD_LIBREALSENSE "Build support for Intel RealSense camera" OFF)
Expand Down
8 changes: 7 additions & 1 deletion cpp/open3d/utility/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ target_sources(utility PRIVATE
Download.cpp
Eigen.cpp
Extract.cpp
ExtractZIP.cpp
FileSystem.cpp
Helper.cpp
IJsonConvertible.cpp
Expand All @@ -19,6 +18,13 @@ target_sources(utility PRIVATE
Timer.cpp
)

if (WITH_MINIZIP)
target_sources(utility PRIVATE
ExtractZIP.cpp
)
target_compile_definitions(utility PRIVATE HAS_MINIZIP)
endif()

if (BUILD_ISPC_MODULE)
target_sources(utility PRIVATE
ISAInfo.ispc
Expand Down
4 changes: 4 additions & 0 deletions cpp/open3d/utility/Extract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

#include <unordered_map>

#ifdef HAS_MINIZIP
#include "open3d/utility/ExtractZIP.h"
#endif
#include "open3d/utility/FileSystem.h"
#include "open3d/utility/Logging.h"

Expand All @@ -20,7 +22,9 @@ static const std::unordered_map<
std::string,
std::function<void(const std::string&, const std::string&)>>
file_extension_to_extract_function{
#if HAS_MINIZIP
{"zip", ExtractFromZIP},
#endif
};

bool IsSupportedCompressedFilePath(const std::string& file_path) {
Expand Down
Loading