Add GLOBAL to add_library(zlib)
@@ -219,7 +219,7 @@ if(OPENEXR_FORCE_INTERNAL_ZLIB OR NOT ZLIB_FOUND)
endif()
if(NOT (APPLE OR WIN32) AND BUILD_SHARED_LIBS AND NOT OPENEXR_FORCE_INTERNAL_ZLIB)
- add_library(zlib_shared SHARED IMPORTED)
+ add_library(zlib_shared SHARED IMPORTED GLOBAL)
add_dependencies(zlib_shared zlib_external)
set_property(TARGET zlib_shared PROPERTY
IMPORTED_LOCATION "${zlib_INTERNAL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}${zliblibname}${CMAKE_SHARED_LIBRARY_SUFFIX}"
@@ -227,7 +227,7 @@ if(OPENEXR_FORCE_INTERNAL_ZLIB OR NOT ZLIB_FOUND)
target_include_directories(zlib_shared INTERFACE "${zlib_INTERNAL_DIR}/include")
endif()
- add_library(zlib_static STATIC IMPORTED)
+ add_library(zlib_static STATIC IMPORTED GLOBAL)
add_dependencies(zlib_static zlib_external)
set_property(TARGET zlib_static PROPERTY
IMPORTED_LOCATION "${zlib_INTERNAL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}${zlibstaticlibname}${CMAKE_STATIC_LIBRARY_SUFFIX}"
