Findstb.cmake 962 B

1234567891011121314151617181920212223242526272829303132
  1. # SPDX-FileCopyrightText: 2023 Alexandre Bouvier <contact@amb.tf>
  2. #
  3. # SPDX-License-Identifier: GPL-3.0-or-later
  4. find_path(stb_image_INCLUDE_DIR stb_image.h PATH_SUFFIXES stb)
  5. find_path(stb_image_resize_INCLUDE_DIR stb_image_resize.h PATH_SUFFIXES stb)
  6. find_path(stb_image_write_INCLUDE_DIR stb_image_write.h PATH_SUFFIXES stb)
  7. include(FindPackageHandleStandardArgs)
  8. find_package_handle_standard_args(stb
  9. REQUIRED_VARS
  10. stb_image_INCLUDE_DIR
  11. stb_image_resize_INCLUDE_DIR
  12. stb_image_write_INCLUDE_DIR
  13. )
  14. if (stb_FOUND AND NOT TARGET stb::headers)
  15. add_library(stb::headers INTERFACE IMPORTED)
  16. set_property(TARGET stb::headers PROPERTY
  17. INTERFACE_INCLUDE_DIRECTORIES
  18. "${stb_image_INCLUDE_DIR}"
  19. "${stb_image_resize_INCLUDE_DIR}"
  20. "${stb_image_write_INCLUDE_DIR}"
  21. )
  22. endif()
  23. mark_as_advanced(
  24. stb_image_INCLUDE_DIR
  25. stb_image_resize_INCLUDE_DIR
  26. stb_image_write_INCLUDE_DIR
  27. )