I built my version of zlib (and by default it builds both static and dynamic) but seemingly it can't find the static one because it's being "zs.lib" and not in the preferred list so it can't find the static but rather the dynamic one.
My CMakeLists.txt (stripped down):
cmake_minimum_required(VERSION 3.10)
set(ZLIB_USE_STATIC_LIBS ON)
find_package(ZLIB REQUIRED)
message(STATUS "ZLIB library: ${ZLIB_LIBRARIES}")
message(STATUS "ZLIB include: ${ZLIB_INCLUDE_DIRS}")
Output (stripped):
1> [CMake] -- ZLIB library: C:/Program Files/zlib/lib/z.lib
1> [CMake] -- ZLIB include: C:/Program Files/zlib/include
which isn't my expected ("zs.lib" which is the static).
What's the workarounds for linking with static version of zlib?