From e814a7f4b2bcf6524fff70c9022fa44e62dbae5e Mon Sep 17 00:00:00 2001 From: Denton Woods Date: Sat, 31 Dec 2016 16:12:50 -0600 Subject: - Adding LittleCMS2 support --- DevIL/cmake/Modules/FindLCMS2.cmake | 26 ++++++++++++++++++++++++++ DevIL/src-IL/CMakeLists.txt | 15 ++++++++------- 2 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 DevIL/cmake/Modules/FindLCMS2.cmake diff --git a/DevIL/cmake/Modules/FindLCMS2.cmake b/DevIL/cmake/Modules/FindLCMS2.cmake new file mode 100644 index 00000000..18396165 --- /dev/null +++ b/DevIL/cmake/Modules/FindLCMS2.cmake @@ -0,0 +1,26 @@ +# - Find LCMS version 2 library +# +# LCMS2_INCLUDE_DIR - Where to find lcms2.h, etc. +# LCMS2_LIBRARIES - Libraries to link against to use LCMS2. +# LCMS2_FOUND - If false, do not try to use LCMS2. +# +# also defined, but not for general use are +# LCMS2_LIBRARY - Where to find the LCMS2 library. + +FIND_PATH(LCMS2_INCLUDE_DIR lcms2.h PATHS /usr/include /usr/local/include /opt/include /opt/local/include) + +SET(LCMS2_NAMES ${LCMS2_NAMES} lcms2 liblcms2 liblcms2_static) + +FIND_LIBRARY(LCMS2_LIBRARY NAMES ${LCMS2_NAMES} ) + +MARK_AS_ADVANCED(LCMS2_INCLUDE_DIR LCMS2_LIBRARY) + +# handle the QUIETLY and REQUIRED arguments and set LCMS2_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LCMS2 DEFAULT_MSG LCMS2_LIBRARY LCMS2_INCLUDE_DIR) + +IF(LCMS2_FOUND) + SET(LCMS2_INCLUDE_DIRS ${LCMS2_INCLUDE_DIR}) + SET(LCMS2_LIBRARIES ${LCMS2_LIBRARY} ) +ENDIF(LCMS2_FOUND) diff --git a/DevIL/src-IL/CMakeLists.txt b/DevIL/src-IL/CMakeLists.txt index 15527614..df863c03 100644 --- a/DevIL/src-IL/CMakeLists.txt +++ b/DevIL/src-IL/CMakeLists.txt @@ -78,7 +78,8 @@ find_package(Jasper) find_package(libSquish) find_package(NVTT) # NVidia texture tools find_package(OpenEXR) -find_package(LCMS) +#find_package(LCMS) +find_package(LCMS2) # TODO: check for libmng, others? @@ -125,13 +126,13 @@ else(MNG_FOUND) set(IL_NO_MNG 1) endif(MNG_FOUND) -if(LCMS_FOUND) +if(LCMS2_FOUND) option(IL_NO_LCMS "Disable LCMS support (Little CMS)" 0) #TODO: be more clever about lcms include... it smells wrong. - option(LCMS_NODIRINCLUDE "Include lcms.h instead of lcms/lcms.h" 1) -else(LCMS_FOUND) + #option(LCMS_NODIRINCLUDE "Include lcms.h instead of lcms/lcms.h" 1) +else(LCMS2_FOUND) set(IL_NO_LCMS 1) -endif(LCMS_FOUND) +endif(LCMS2_FOUND) if(NVTT_FOUND) option(IL_USE_DXTC_NVIDIA "Use Nvidia Texture Tools (NVTT) for DXTC support" 1) @@ -199,8 +200,8 @@ if(NOT IL_NO_MNG) endif(NOT IL_NO_MNG) if(NOT IL_NO_LCMS) - list(APPEND incs ${LCMS_INCLUDE_DIRS} ) - list(APPEND libs ${LCMS_LIBRARIES} ) + list(APPEND incs ${LCMS2_INCLUDE_DIRS} ) + list(APPEND libs ${LCMS2_LIBRARIES} ) endif(NOT IL_NO_LCMS) if(NOT IL_NO_EXR) -- cgit v1.2.1