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