FindZLIB_compat_unixlike.cmake 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. #
  2. # Copyright (c) Contributors to the Open 3D Engine Project.
  3. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. #
  5. # SPDX-License-Identifier: Apache-2.0 OR MIT
  6. #
  7. #
  8. # this file is provided to give compatibility to non-o3de-projects
  9. # it defines the same targets as is defined in the default FindZLIB.cmake
  10. # shipped with CMAKE.
  11. # Its meant to be deployed into the zlib subfolder of the package
  12. # and then allows you set the variable ZLIB_ROOT on the command line to point at this folder,
  13. # to force it to use this package instead of system ZLIB.
  14. set(ZLIB_INCLUDE_DIRS ${CMAKE_CURRENT_LIST_DIR}/include)
  15. set(ZLIB_INCLUDE_DIR ${ZLIB_INCLUDE_DIRS})
  16. set(ZLIB_LIBRARIES ${CMAKE_CURRENT_LIST_DIR}/lib/libz.a)
  17. set(ZLIB_LIBRARY ${ZLIB_LIBRARIES})
  18. set(ZLIB_FOUND True)
  19. set(ZLIB_VERSION_STRING "1.2.11")
  20. set(ZLIB_VERSION_MAJOR "1")
  21. set(ZLIB_VERSION_MINOR "2")
  22. set(ZLIB_VERSION_PATCH "11")
  23. set(ZLIB_MAJOR_VERSION "1")
  24. set(ZLIB_MINOR_VERSION "2")
  25. set(ZLIB_PATCH_VERSION "11")
  26. add_library(ZLIB::ZLIB INTERFACE IMPORTED GLOBAL)
  27. set_target_properties(ZLIB::ZLIB PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}")
  28. target_link_libraries(ZLIB::ZLIB INTERFACE ${ZLIB_LIBRARIES})