FindDevIL.cmake 2.5 KB

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