Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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/assimp/assimp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ else()
set(lib_name assimp)
endif()

ExternalProject_Get_Property(ext_zlib INSTALL_DIR)
set(ZLIB_INSTALL_DIR ${INSTALL_DIR})
unset(INSTALL_DIR)

# IntelLLVM (SYCL) compiler defaults to fast math, causing NaN comparison code
# compilation error.
if(CMAKE_CXX_COMPILER_ID MATCHES "IntelLLVM")
Expand All @@ -29,7 +33,8 @@ ExternalProject_Add(
-DASSIMP_BUILD_ASSIMP_TOOLS=OFF
-DASSIMP_BUILD_TESTS=OFF
-DASSIMP_INSTALL_PDB=OFF
-DASSIMP_BUILD_ZLIB=ON
-DASSIMP_BUILD_ZLIB=OFF
-DZLIB_ROOT:PATH=${ZLIB_INSTALL_DIR}
-DASSIMP_NO_EXPORT=OFF
-DHUNTER_ENABLED=OFF # Renamed to "ASSIMP_HUNTER_ENABLED" in newer assimp.
-DASSIMP_WARNINGS_AS_ERRORS=OFF
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/civetweb/civetweb.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ExternalProject_Add(
DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/civetweb"
UPDATE_COMMAND ""
CMAKE_ARGS
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
-DCMAKE_POLICY_VERSION_MINIMUM=3.10
-DCIVETWEB_BUILD_TESTING=OFF
-DCIVETWEB_ENABLE_CXX=ON
-DCIVETWEB_SSL_OPENSSL_API_1_0=OFF
Expand Down
94 changes: 60 additions & 34 deletions 3rdparty/find_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -494,28 +494,7 @@ open3d_find_package_3rdparty_library(3rdparty_threads
TARGETS Threads::Threads
)

# Assimp
if(USE_SYSTEM_ASSIMP)
open3d_find_package_3rdparty_library(3rdparty_assimp
PACKAGE assimp
TARGETS assimp::assimp
)
if(NOT 3rdparty_assimp_FOUND)
set(USE_SYSTEM_ASSIMP OFF)
endif()
endif()
if(NOT USE_SYSTEM_ASSIMP)
include(${Open3D_3RDPARTY_DIR}/assimp/assimp.cmake)
open3d_import_3rdparty_library(3rdparty_assimp
INCLUDE_DIRS ${ASSIMP_INCLUDE_DIR}
LIB_DIR ${ASSIMP_LIB_DIR}
LIBRARIES ${ASSIMP_LIBRARIES}
DEPENDS ext_assimp
)
list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_CUSTOM Open3D::3rdparty_assimp)
else()
list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM Open3D::3rdparty_assimp)
endif()


# OpenMP
if(WITH_OPENMP)
Expand Down Expand Up @@ -855,6 +834,50 @@ if (BUILD_LIBREALSENSE)
endif()
endif()

if(USE_SYSTEM_ZLIB)
open3d_find_package_3rdparty_library(3rdparty_zlib
PACKAGE zlib
TARGETS ZLIB::zlib
)
list(APPEND Open3D_3RDPARTY_HEADER_TARGETS_FROM_SYSTEM Open3D::3rdparty_zlib)
endif()
if(NOT USE_SYSTEM_ZLIB)
include(${Open3D_3RDPARTY_DIR}/zlib/zlib.cmake)
open3d_import_3rdparty_library(3rdparty_zlib
HIDDEN
INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS}
LIB_DIR ${ZLIB_LIB_DIR}
LIBRARIES ${ZLIB_LIBRARIES}
DEPENDS ext_zlib
)
list(APPEND Open3D_3RDPARTY_HEADER_TARGETS_FROM_CUSTOM Open3D::3rdparty_zlib)
endif()

# Assimp
if(USE_SYSTEM_ASSIMP)
open3d_find_package_3rdparty_library(3rdparty_assimp
PACKAGE assimp
TARGETS assimp::assimp
)
if(NOT 3rdparty_assimp_FOUND)
set(USE_SYSTEM_ASSIMP OFF)
endif()
endif()
if(NOT USE_SYSTEM_ASSIMP)
include(${Open3D_3RDPARTY_DIR}/assimp/assimp.cmake)
open3d_import_3rdparty_library(3rdparty_assimp
INCLUDE_DIRS ${ASSIMP_INCLUDE_DIR}
LIB_DIR ${ASSIMP_LIB_DIR}
LIBRARIES ${ASSIMP_LIBRARIES}
DEPENDS ext_assimp
)
add_dependencies(ext_assimp ext_zlib)
target_link_libraries(3rdparty_assimp INTERFACE Open3D::3rdparty_zlib)
list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_CUSTOM Open3D::3rdparty_assimp)
else()
list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM Open3D::3rdparty_assimp)
endif()

# Curl
# - Curl should be linked before PNG, otherwise it will have undefined symbols.
# - openssl.cmake needs to be included before curl.cmake, for the
Expand Down Expand Up @@ -927,15 +950,6 @@ if(USE_SYSTEM_PNG)
endif()
endif()
if(NOT USE_SYSTEM_PNG)
include(${Open3D_3RDPARTY_DIR}/zlib/zlib.cmake)
open3d_import_3rdparty_library(3rdparty_zlib
HIDDEN
INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS}
LIB_DIR ${ZLIB_LIB_DIR}
LIBRARIES ${ZLIB_LIBRARIES}
DEPENDS ext_zlib
)

include(${Open3D_3RDPARTY_DIR}/libpng/libpng.cmake)
open3d_import_3rdparty_library(3rdparty_png
INCLUDE_DIRS ${LIBPNG_INCLUDE_DIRS}
Expand Down Expand Up @@ -1138,12 +1152,24 @@ open3d_import_3rdparty_library(3rdparty_poisson
list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_CUSTOM Open3D::3rdparty_poisson)

# Minizip
if(WITH_MINIZIP)
open3d_pkg_config_3rdparty_library(3rdparty_minizip
SEARCH_ARGS minizip
if(USE_SYSTEM_MINIZIP)
open3d_find_package_3rdparty_library(3rdparty_zlib
PACKAGE minizip
TARGETS MINIZIP::minizip
)
list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM Open3D::3rdparty_minizip)
endif()
if(NOT USE_SYSTEM_MINIZIP)
include(${Open3D_3RDPARTY_DIR}/zlib/minizip.cmake)
open3d_import_3rdparty_library(3rdparty_minizip
HIDDEN
INCLUDE_DIRS ${MINIZIP_INCLUDE_DIRS}
LIB_DIR ${MINIZIP_LIB_DIR}
LIBRARIES ${MINIZIP_LIBRARIES}
DEPENDS ext_minizip
)
list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_CUSTOM Open3D::3rdparty_minizip)
endif()

# Googletest
if (BUILD_UNIT_TESTS)
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/fmt/fmt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ExternalProject_Add(
-DFMT_DOC=OFF
-DFMT_TEST=OFF
-DFMT_FUZZ=OFF
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
-DCMAKE_POLICY_VERSION_MINIMUM=3.10
BUILD_BYPRODUCTS
<INSTALL_DIR>/${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${FMT_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
<INSTALL_DIR>/${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${FMT_LIB_NAME}d${CMAKE_STATIC_LIBRARY_SUFFIX}
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/libjpeg-turbo/libjpeg-turbo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ ExternalProject_Add(
DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/libjpeg-turbo"
UPDATE_COMMAND ""
CMAKE_ARGS
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
-DCMAKE_POLICY_VERSION_MINIMUM=3.10
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DWITH_CRT_DLL=${WITH_CRT_DLL}
-DENABLE_STATIC=ON
Expand Down
14 changes: 9 additions & 5 deletions 3rdparty/libpng/libpng.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,25 @@ else()
set(LIBPNG_LIB_NAME png16)
endif()

ExternalProject_Get_Property(ext_zlib INSTALL_DIR)
set(ZLIB_INSTALL_DIR ${INSTALL_DIR})
unset(INSTALL_DIR)

ExternalProject_Add(
ext_libpng
PREFIX libpng
URL https://github.com/glennrp/libpng/archive/refs/tags/v1.6.37.tar.gz
URL_HASH SHA256=ca74a0dace179a8422187671aee97dd3892b53e168627145271cad5b5ac81307
URL https://github.com/glennrp/libpng/archive/refs/tags/v1.6.47.tar.gz
URL_HASH SHA256=631a4c58ea6c10c81f160c4b21fa8495b715d251698ebc2552077e8450f30454
DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/libpng"
UPDATE_COMMAND ""
CMAKE_ARGS
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
-DCMAKE_POLICY_VERSION_MINIMUM=3.10
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DPNG_SHARED=OFF
-DPNG_EXECUTABLES=OFF
-DPNG_TESTS=OFF
-DPNG_BUILD_ZLIB=ON # Prevent libpng from calling find_pacakge(zlib).
-DZLIB_INCLUDE_DIR=${ZLIB_INCLUDE_DIRS}
-DPNG_BUILD_ZLIB=OFF
-DZLIB_ROOT:PATH=${ZLIB_INSTALL_DIR}
-DPNG_ARM_NEON=off # Must be lower case.
${ExternalProject_CMAKE_ARGS_hidden}
BUILD_BYPRODUCTS
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/librealsense/librealsense.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ExternalProject_Add(
COMMAND ${GIT_EXECUTABLE} apply --ignore-space-change --ignore-whitespace
${CMAKE_CURRENT_LIST_DIR}/fix-macos-arm64.patch
CMAKE_ARGS
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
-DCMAKE_POLICY_VERSION_MINIMUM=3.10
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DBUILD_SHARED_LIBS=OFF
-DBUILD_EXAMPLES=OFF
Expand Down
1 change: 1 addition & 0 deletions 3rdparty/openblas/openblas.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ExternalProject_Add(
DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/openblas"
CMAKE_ARGS
${ExternalProject_CMAKE_ARGS}
-DCMAKE_POLICY_VERSION_MINIMUM=3.10
-DTARGET=${OPENBLAS_TARGET}
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
BUILD_BYPRODUCTS
Expand Down
21 changes: 21 additions & 0 deletions 3rdparty/possionrecon/eigen_rows.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff -u a/Src/SparseMatrix.inl b/Src/SparseMatrix.inl
--- a/Src/SparseMatrix.inl
+++ b/Src/SparseMatrix.inl
@@ -463,7 +463,7 @@
A.resize( aRows );
for( size_t i=0 ; i<aRows ; i++ ) A.rowSizes[i] = 0;
for( size_t i=0 ; i<At.rows() ; i++ ) for( const_iterator iter=At.begin(i) ; iter!=At.end(i) ; iter++ ) A.rowSizes[ iter->N ]++;
- for( size_t i=0 ; i<A.rows ; i++ )
+ for( size_t i=0 ; i<A.rows() ; i++ )
{
size_t t = A.rowSizes[i];
A.rowSizes[i] = 0;
@@ -496,7 +496,7 @@
A.resize( aRows );
for( size_t i=0 ; i<aRows ; i++ ) A.rowSizes[i] = 0;
for( size_t i=0 ; i<At.rows() ; i++ ) for( const_iterator iter=At.begin(i) ; iter!=At.end(i) ; iter++ ) A.rowSizes[ iter->N ]++;
- for( size_t i=0 ; i<A.rows ; i++ )
+ for( size_t i=0 ; i<A.rows() ; i++ )
{
size_t t = A.rowSizes[i];
A.rowSizes[i] = 0;
3 changes: 3 additions & 0 deletions 3rdparty/possionrecon/possionrecon.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ ExternalProject_Add(
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
PATCH_COMMAND ${GIT_EXECUTABLE} init
COMMAND ${GIT_EXECUTABLE} apply --ignore-space-change --ignore-whitespace --verbose
${CMAKE_CURRENT_LIST_DIR}/eigen_rows.patch
)

ExternalProject_Get_Property(ext_poisson SOURCE_DIR)
Expand Down
1 change: 1 addition & 0 deletions 3rdparty/vtk/vtk_build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ if(BUILD_VTK_FROM_SOURCE)
UPDATE_COMMAND ""
CMAKE_ARGS
${ExternalProject_CMAKE_ARGS_hidden}
-DCMAKE_POLICY_VERSION_MINIMUM=3.10
-DBUILD_SHARED_LIBS=OFF
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DVTK_GROUP_ENABLE_Imaging=NO
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/zeromq/zeromq_build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ExternalProject_Add(
# Does not seem to work. We have to directly set the flags on Windows.
#-DCMAKE_POLICY_DEFAULT_CMP0091:STRING=NEW
#-DCMAKE_MSVC_RUNTIME_LIBRARY:STRING=${CMAKE_MSVC_RUNTIME_LIBRARY}
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
-DCMAKE_POLICY_VERSION_MINIMUM=3.10
-DBUILD_STATIC=ON
-DBUILD_SHARED=OFF
-DBUILD_TESTS=OFF
Expand Down
63 changes: 0 additions & 63 deletions 3rdparty/zlib/0001-patch-zlib-to-enable-unzip.patch

This file was deleted.

18 changes: 18 additions & 0 deletions 3rdparty/zlib/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,21 @@ Gailly and Mark Adler; it does not include third-party code.
If you redistribute modified sources, we would appreciate that you include in
the file ChangeLog history information documenting your changes. Please read
the FAQ for more information on the distribution of modified source versions.

Condition of use and distribution are the same as zlib:

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgement in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
40 changes: 40 additions & 0 deletions 3rdparty/zlib/minizip.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
include(ExternalProject)

find_package(Git QUIET REQUIRED)

ExternalProject_Get_Property(ext_zlib INSTALL_DIR)
set(ZLIB_INSTALL_DIR ${INSTALL_DIR})
unset(INSTALL_DIR)

set(lib_name minizip)

ExternalProject_Add(ext_minizip
PREFIX minizip-ng
URL https://github.com/zlib-ng/minizip-ng/archive/refs/tags/4.0.7.tar.gz
URL_HASH SHA256=a87f1f734f97095fe1ef0018217c149d53d0f78438bcb77af38adc21dff2dfbc
DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/minizip-ng"
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DMZ_COMPAT:BOOL=ON
-DMZ_ZLIB:BOOL=ON
-DMZ_BZIP2:BOOL=OFF
-DMZ_LZMA:BOOL=OFF
-DMZ_ZSTD:BOOL=OFF
-DMZ_LIBCOMP:BOOL=OFF
-DMZ_FETCH_LIBS:BOOL=OFF
-DMZ_FORCE_FETCH_LIBS:BOOL=OFF
-DMZ_PKCRYPT:BOOL=OFF
-DMZ_WZAES:BOOL=OFF
-DMZ_OPENSSL:BOOL=OFF
-DMZ_LIBBSD:BOOL=OFF
-DMZ_ICONV:BOOL=OFF
-DZLIB_ROOT:PATH=${ZLIB_INSTALL_DIR}
${ExternalProject_CMAKE_ARGS}
BUILD_BYPRODUCTS
<INSTALL_DIR>/lib/${CMAKE_STATIC_LIBRARY_PREFIX}${lib_name}${CMAKE_STATIC_LIBRARY_SUFFIX}
)

ExternalProject_Get_Property(ext_minizip INSTALL_DIR)
set(MINIZIP_INCLUDE_DIRS ${INSTALL_DIR}/include/minizip/) # "/" is critical.
set(MINIZIP_LIB_DIR ${INSTALL_DIR}/lib)
set(MINIZIP_LIBRARIES ${lib_name})
Loading
Loading