PNG.cmake 874 B

123456789101112131415161718192021222324252627
  1. if (APPLE)
  2. # Only disable NEON extension for Apple ARM builds, leave it enabled for Raspberry PI.
  3. set(_disable_neon_extension "-DPNG_ARM_NEON:STRING=off")
  4. else ()
  5. set(_disable_neon_extension "")
  6. endif ()
  7. set(_patch_cmd PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt.patched CMakeLists.txt)
  8. if (APPLE)
  9. set(_patch_cmd ${_patch_cmd} && ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/PNG.patch)
  10. endif ()
  11. add_cmake_project(PNG
  12. URL https://github.com/glennrp/libpng/archive/refs/tags/v1.6.35.zip
  13. URL_HASH SHA256=3d22d46c566b1761a0e15ea397589b3a5f36ac09b7c785382e6470156c04247f
  14. PATCH_COMMAND "${_patch_cmd}"
  15. CMAKE_ARGS
  16. -DPNG_SHARED=OFF
  17. -DPNG_STATIC=ON
  18. -DPNG_PREFIX=prusaslicer_
  19. -DPNG_TESTS=OFF
  20. -DPNG_EXECUTABLES=OFF
  21. ${_disable_neon_extension}
  22. )
  23. set(DEP_PNG_DEPENDS ZLIB)