Skip to content

Commit d03456c

Browse files
committed
Add minizip-ng dependency
Signed-off-by: Darby Johnston <[email protected]>
1 parent f662359 commit d03456c

File tree

5 files changed

+44
-17
lines changed

5 files changed

+44
-17
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@
77
[submodule "src/deps/Imath"]
88
path = src/deps/Imath
99
url = https://github.com/AcademySoftwareFoundation/Imath
10+
[submodule "src/deps/minizip-ng"]
11+
path = src/deps/minizip-ng
12+
url = https://github.com/zlib-ng/minizip-ng.git

CMakeLists.txt

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ project(OpenTimelineIO VERSION ${OTIO_VERSION} LANGUAGES C CXX)
2828
# Installation options
2929
option(OTIO_CXX_INSTALL "Install the C++ bindings" ON)
3030
option(OTIO_PYTHON_INSTALL "Install the Python bindings" OFF)
31-
option(OTIO_DEPENDENCIES_INSTALL "Install OTIO's C++ header dependencies (Imath)" ON)
3231
option(OTIO_INSTALL_PYTHON_MODULES "Install OTIO pure Python modules/files" ON)
3332
option(OTIO_INSTALL_COMMANDLINE_TOOLS "Install the OTIO command line tools" ON)
3433
option(OTIO_INSTALL_CONTRIB "Install the opentimelineio_contrib Python package" ON)
3534
option(OTIO_FIND_IMATH "Find Imath using find_package" OFF)
3635
option(OTIO_FIND_RAPIDJSON "Find RapidJSON using find_package" OFF)
36+
option(OTIO_FIND_MINIZIP_NG "Find minizip-ng using find_package" OFF)
3737
set(OTIO_PYTHON_INSTALL_DIR "" CACHE STRING "Python installation dir (such as the site-packages dir)")
3838

3939
# Build options
@@ -148,12 +148,6 @@ set(OTIO_RESOLVED_CXX_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}")
148148
if(OTIO_CXX_INSTALL)
149149
message(STATUS "Installing C++ bindings to: ${OTIO_RESOLVED_CXX_INSTALL_DIR}")
150150
message(STATUS "Installing C++ dynamic libraries to: ${OTIO_RESOLVED_CXX_DYLIB_INSTALL_DIR}")
151-
152-
if(OTIO_DEPENDENCIES_INSTALL)
153-
message(STATUS " Installing header dependencies for C++ (OTIO_DEPENDENCIES_INSTALL=ON)")
154-
else()
155-
message(STATUS " Not installing header dependencies for C++ (OTIO_DEPENDENCIES_INSTALL=OFF)")
156-
endif()
157151
else()
158152
message(STATUS "Install C++ bindings: OFF")
159153
endif()
@@ -263,6 +257,16 @@ else()
263257
message(STATUS "Using src/deps/rapidjson by default")
264258
endif()
265259

260+
#----- minizip-ng
261+
if(OTIO_FIND_MINIZIP_NG)
262+
find_package(minizip-ng CONFIG REQUIRED)
263+
if (minizip-ng_FOUND)
264+
message(STATUS "Found minizip-ng at ${minizip-ng_CONFIG}")
265+
endif()
266+
else()
267+
message(STATUS "Using src/deps/minizip-ng by default")
268+
endif()
269+
266270
# set up the internally hosted dependencies
267271
add_subdirectory(src/deps)
268272

src/deps/CMakeLists.txt

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ set(DEPS_SUBMODULES pybind11)
99
if(NOT OTIO_FIND_RAPIDJSON)
1010
set(DEPS_SUBMODULES ${DEPS_SUBMODULES} rapidjson)
1111
endif()
12+
if(NOT OTIO_FIND_MINIZIP_NG)
13+
set(DEPS_SUBMODULES ${DEPS_SUBMODULES} minizip-ng)
14+
endif()
1215

1316
foreach(submodule IN LISTS DEPS_SUBMODULES)
1417
file(GLOB SUBMOD_CONTENTS ${submodule})
@@ -26,15 +29,30 @@ if(OTIO_PYTHON_INSTALL)
2629
endif()
2730

2831
if(NOT OTIO_FIND_IMATH)
29-
# preserve BUILD_SHARED_LIBS options for this project, but set it off for Imath
30-
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
3132
set(BUILD_SHARED_LIBS OFF)
32-
33-
# If we do not want Imath to install headers and CMake files use the EXCLUDE_FROM_ALL option
34-
if(OTIO_CXX_INSTALL AND OTIO_DEPENDENCIES_INSTALL)
35-
add_subdirectory(Imath)
36-
else()
37-
add_subdirectory(Imath EXCLUDE_FROM_ALL)
38-
endif()
3933
endif()
4034

35+
if(NOT OTIO_FIND_MINIZIP_NG)
36+
set(BUILD_SHARED_LIBS OFF)
37+
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
38+
set(MZ_COMPAT ON)
39+
set(MZ_ZLIB ON)
40+
set(MZ_BZIP2 OFF)
41+
set(MZ_LZMA OFF)
42+
set(MZ_ZSTD OFF)
43+
set(MZ_LIBCOMP OFF)
44+
set(MZ_PKCRYPT OFF)
45+
set(MZ_WZAES OFF)
46+
set(MZ_OPENSSL OFF)
47+
set(MZ_LIBBSD OFF)
48+
set(MZ_ICONV OFF)
49+
set(MZ_FETCH_LIBS ON)
50+
set(MZ_FORCE_FETCH_LIBS ON)
51+
add_subdirectory(minizip-ng)
52+
53+
# TODO This is a temporary workaround to find zlib-ng. For some reason
54+
# zlib-ng is not installing it's own CMake configuration files when built
55+
# by minizip-ng.
56+
install(FILES zlibng-config.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/zlibng)
57+
58+
endif()

src/deps/minizip-ng

Submodule minizip-ng added at f3ed731

src/opentimelineio/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ endif()
9292

9393

9494
target_link_libraries(opentimelineio
95-
PUBLIC opentime Imath::Imath)
95+
PUBLIC opentime Imath::Imath
96+
PRIVATE MINIZIP::minizip)
9697

9798
set_target_properties(opentimelineio PROPERTIES
9899
DEBUG_POSTFIX "${OTIO_DEBUG_POSTFIX}"

0 commit comments

Comments
 (0)