Skip to content

Commit 6e813e8

Browse files
committed
Add a workaround for finding zlibng, and try shared libraries
Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
1 parent da755dd commit 6e813e8

File tree

3 files changed

+13
-18
lines changed

3 files changed

+13
-18
lines changed

CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ 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)
@@ -149,12 +148,6 @@ set(OTIO_RESOLVED_CXX_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}")
149148
if(OTIO_CXX_INSTALL)
150149
message(STATUS "Installing C++ bindings to: ${OTIO_RESOLVED_CXX_INSTALL_DIR}")
151150
message(STATUS "Installing C++ dynamic libraries to: ${OTIO_RESOLVED_CXX_DYLIB_INSTALL_DIR}")
152-
153-
if(OTIO_DEPENDENCIES_INSTALL)
154-
message(STATUS " Installing header dependencies for C++ (OTIO_DEPENDENCIES_INSTALL=ON)")
155-
else()
156-
message(STATUS " Not installing header dependencies for C++ (OTIO_DEPENDENCIES_INSTALL=OFF)")
157-
endif()
158151
else()
159152
message(STATUS "Install C++ bindings: OFF")
160153
endif()

src/deps/CMakeLists.txt

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,10 @@ if(OTIO_PYTHON_INSTALL)
2929
endif()
3030

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

4435
if(NOT OTIO_FIND_MINIZIP_NG)
45-
set(BUILD_SHARED_LIBS OFF)
4636
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
4737
set(MZ_COMPAT ON)
4838
set(MZ_ZLIB ON)
@@ -55,5 +45,13 @@ if(NOT OTIO_FIND_MINIZIP_NG)
5545
set(MZ_OPENSSL OFF)
5646
set(MZ_LIBBSD OFF)
5747
set(MZ_ICONV OFF)
48+
set(MZ_FETCH_LIBS ON)
49+
set(MZ_FORCE_FETCH_LIBS ON)
5850
add_subdirectory(minizip-ng)
51+
52+
# TODO This is a temporary workaround to find zlib-ng. For some reason
53+
# zlib-ng is not installing it's own CMake configuration files when built
54+
# by minizip-ng.
55+
install(FILES zlibng-config.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/zlibng)
56+
5957
endif()

src/deps/zlibng-config.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
2+
set(ZLIBNG_INCLUDE_DIRS "${_IMPORT_PREFIX}/include")
3+
set(ZLIBNG_LIBRARIES "z-ng")
4+
set(ZLIBNG_LIBRARY_DIRS "${_IMPORT_PREFIX}/lib")

0 commit comments

Comments
 (0)