Open
Description
Branch: master (f04fcdd)
Trying to use a Windows build of OpenEXR built with built-in zlib fails at first with the following error at CMake time:
Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
...
... /openexr/lib/cmake/OpenEXR/OpenEXRConfig.cmake:31 (find_dependency)
This is due to find_dependency(ZLIB REQUIRED) in OpenEXRConfig.cmake:31.
If I manually comment out that line, CMake succeeds, but now I get a linker error:
LINK : fatal error LNK1181: cannot open input file 'zlib_static.lib'
This is due to zlib_static being present in the INTERFACE_LINK_LIBRARIES of OpenEXR::OpenEXR
If I also manually remove zlib_static (from OpenEXRTargets.cmake) then my program all builds and runs fine.
I believe if OpenEXR is built with internal static zlib library, then zlib should not appear as a dependency and neither at the interface link libraries.