Hello,

When both libcms1 and libcms2 are present, liblcms2 is automatically selected 
with no way to override the choice. Patch adds the choice by the means of 
ENABLE_LCMS2 option.

-- 
regards
MM
From df72aa3746fb52c71458d2c662675bfc132185dd Mon Sep 17 00:00:00 2001
From: Maciej Mrozowski <[email protected]>
Date: Fri, 18 May 2012 01:47:55 +0200
Subject: [PATCH] [CMake] Provide ENABLE_LCMS2 option to distinguish between available liblcms implementations when both are present during configure phase.

---
 CMakeLists.txt |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9f4830b..e9246b1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,6 +29,7 @@ option(ENABLE_UTILS "Compile poppler command line utils." ON)
 option(ENABLE_CPP "Compile poppler cpp wrapper." ON)
 option(ENABLE_LIBOPENJPEG "Use libopenjpeg for JPX streams." ON)
 option(ENABLE_LCMS "Use liblcms for color management." ON)
+option(ENABLE_LCMS2 "Use liblcms2 for color management." ON)
 option(ENABLE_LIBCURL "Build libcurl based HTTP support." OFF)
 option(ENABLE_ZLIB "Build with zlib (not totally safe)." OFF)
 option(USE_FIXEDPOINT "Use fixed point arithmetic in the Splash backend" OFF)
@@ -136,16 +137,14 @@ if(ENABLE_LIBOPENJPEG)
   set(ENABLE_LIBOPENJPEG ${LIBOPENJPEG_FOUND})
   set(HAVE_OPENJPEG_H ON)
 endif(ENABLE_LIBOPENJPEG)
-if(ENABLE_LCMS)
+if(ENABLE_LCMS2)
   find_package(LCMS2)
-  if(LCMS2_FOUND)
-    set(USE_CMS ${LCMS2_FOUND})
-  else(LCMS2_FOUND)
-    find_package(LCMS)
-    set(USE_CMS ${LCMS_FOUND})
-    set(USE_LCMS1 ${LCMS_FOUND})
-  endif(LCMS2_FOUND)
-endif(ENABLE_LCMS)
+  set(USE_CMS ${LCMS2_FOUND})
+elseif(ENABLE_LCMS)
+  find_package(LCMS)
+  set(USE_CMS ${LCMS_FOUND})
+  set(USE_LCMS1 ${LCMS_FOUND})
+endif(ENABLE_LCMS2)
 if(ENABLE_LIBCURL)
   find_package(CURL)
   include_directories(${CURL_INCLUDE_DIR})
-- 
1.7.3.4

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
poppler mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to