FindDevIL.cmake 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. #[=======================================================================[.rst:
  4. FindDevIL
  5. ---------
  6. This module locates the developer's image library.
  7. http://openil.sourceforge.net/
  8. This module sets:
  9. ::
  10. IL_LIBRARIES - the name of the IL library. These include the full path to
  11. the core DevIL library. This one has to be linked into the
  12. application.
  13. ILU_LIBRARIES - the name of the ILU library. Again, the full path. This
  14. library is for filters and effects, not actual loading. It
  15. doesn't have to be linked if the functionality it provides
  16. is not used.
  17. ILUT_LIBRARIES - the name of the ILUT library. Full path. This part of the
  18. library interfaces with OpenGL. It is not strictly needed
  19. in applications.
  20. IL_INCLUDE_DIR - where to find the il.h, ilu.h and ilut.h files.
  21. DevIL_FOUND - this is set to TRUE if all the above variables were set.
  22. This will be set to false if ILU or ILUT are not found,
  23. even if they are not needed. In most systems, if one
  24. library is found all the others are as well. That's the
  25. way the DevIL developers release it.
  26. #]=======================================================================]
  27. # TODO: Add version support.
  28. # Tested under Linux and Windows (MSVC)
  29. include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
  30. find_path(IL_INCLUDE_DIR il.h
  31. PATH_SUFFIXES include IL
  32. DOC "The path to the directory that contains il.h"
  33. )
  34. #message("IL_INCLUDE_DIR is ${IL_INCLUDE_DIR}")
  35. find_library(IL_LIBRARIES
  36. NAMES IL DEVIL
  37. PATH_SUFFIXES libx32 lib64 lib lib32
  38. DOC "The file that corresponds to the base il library."
  39. )
  40. #message("IL_LIBRARIES is ${IL_LIBRARIES}")
  41. find_library(ILUT_LIBRARIES
  42. NAMES ILUT
  43. PATH_SUFFIXES libx32 lib64 lib lib32
  44. DOC "The file that corresponds to the il (system?) utility library."
  45. )
  46. #message("ILUT_LIBRARIES is ${ILUT_LIBRARIES}")
  47. find_library(ILU_LIBRARIES
  48. NAMES ILU
  49. PATH_SUFFIXES libx32 lib64 lib lib32
  50. DOC "The file that corresponds to the il utility library."
  51. )
  52. #message("ILU_LIBRARIES is ${ILU_LIBRARIES}")
  53. FIND_PACKAGE_HANDLE_STANDARD_ARGS(DevIL DEFAULT_MSG
  54. IL_LIBRARIES ILU_LIBRARIES
  55. IL_INCLUDE_DIR)
  56. # provide legacy variable for compatibility
  57. set(IL_FOUND ${DevIL_FOUND})