summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenton Woods <denton.woods@gmail.com>2016-12-31 16:12:50 -0600
committerDenton Woods <denton.woods@gmail.com>2016-12-31 16:12:50 -0600
commite814a7f4b2bcf6524fff70c9022fa44e62dbae5e (patch)
tree340994f0a40c2c05f62bae0885703058028eb7da
parentf28c2ded379ef61d708fe0d85ea6e4269407d785 (diff)
downloaddevil-e814a7f4b2bcf6524fff70c9022fa44e62dbae5e.tar.gz
- Adding LittleCMS2 support
-rw-r--r--DevIL/cmake/Modules/FindLCMS2.cmake26
-rw-r--r--DevIL/src-IL/CMakeLists.txt15
2 files changed, 34 insertions, 7 deletions
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)