1
0

zlib_external.cmake 782 B

12345678910111213141516171819202122
  1. # ZLIB
  2. # Fix Windows missing "zlib.dll":
  3. if(WIN32 AND (${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}))
  4. set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}/$<CONFIG> CACHE INTERNAL "" FORCE)
  5. endif()
  6. set(ZLIB_COMPAT ON CACHE INTERNAL "" FORCE)
  7. set(ZLIB_ENABLE_TESTS OFF CACHE INTERNAL "" FORCE)
  8. FetchContent_Declare(zlib
  9. GIT_REPOSITORY https://github.com/zlib-ng/zlib-ng
  10. GIT_TAG 2.0.6
  11. USES_TERMINAL_DOWNLOAD TRUE)
  12. FetchContent_MakeAvailable(zlib)
  13. # Fix Windows zlib dll names from "zlibd1.dll" to "zlib.dll":
  14. if(WIN32)
  15. set_target_properties(zlib PROPERTIES OUTPUT_NAME "zlib")
  16. set_target_properties(zlib PROPERTIES DEBUG_POSTFIX "")
  17. set_target_properties(zlib PROPERTIES SUFFIX ".dll")
  18. endif()