set(ZLIB_ROOT $ENV{REZ_ZLIB_ROOT})
find_package(ZLIB)
set(zlib_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS})
get_filename_component(zlib_LIBRARY_DIRS ${ZLIB_LIBRARIES} PATH)
if(zlib_STATIC)
	set(zlib_LIBRARIES ${zlib_LIBRARY_DIRS}/libz.a)
else()
	set(zlib_LIBRARIES ${ZLIB_LIBRARIES})
endif()