[poppler] CMakeLists.txt configure.ac
Albert Astals Cid
aacid at kemper.freedesktop.org
Mon Jun 18 15:13:06 PDT 2012
CMakeLists.txt | 20 +++++++++++++-------
configure.ac | 31 +++++++++++++++----------------
2 files changed, 28 insertions(+), 23 deletions(-)
New commits:
commit b15d02b92aca1348564e70d0245064bc27eefce8
Author: Maciej Mrozowski <reavertm at gmail.com>
Date: Fri May 18 01:47:55 2012 +0200
Add the possibility of using lcms1 even if lcms2 is installed
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9f4830b..8b07470 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,7 +28,7 @@ option(ENABLE_SPLASH "Build the Splash graphics backend." ON)
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)
+set(ENABLE_CMS "auto" CACHE STRING "Use color management system. Possible values: auto, lcms1, lcms2. 'auto' prefers lcms2 over lcms1 if both are available. Unset to disable color management system.")
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 +136,22 @@ if(ENABLE_LIBOPENJPEG)
set(ENABLE_LIBOPENJPEG ${LIBOPENJPEG_FOUND})
set(HAVE_OPENJPEG_H ON)
endif(ENABLE_LIBOPENJPEG)
-if(ENABLE_LCMS)
+if(ENABLE_CMS STREQUAL "auto")
find_package(LCMS2)
- if(LCMS2_FOUND)
- set(USE_CMS ${LCMS2_FOUND})
- else(LCMS2_FOUND)
+ set(USE_CMS ${LCMS2_FOUND})
+ if(NOT LCMS2_FOUND)
find_package(LCMS)
set(USE_CMS ${LCMS_FOUND})
set(USE_LCMS1 ${LCMS_FOUND})
- endif(LCMS2_FOUND)
-endif(ENABLE_LCMS)
+ endif(NOT LCMS2_FOUND)
+elseif(ENABLE_CMS STREQUAL "lcms1")
+ find_package(LCMS)
+ set(USE_CMS ${LCMS_FOUND})
+ set(USE_LCMS1 ${LCMS_FOUND})
+elseif(ENABLE_CMS STREQUAL "lcms2")
+ find_package(LCMS2)
+ set(USE_CMS ${LCMS2_FOUND})
+endif()
if(ENABLE_LIBCURL)
find_package(CURL)
include_directories(${CURL_INCLUDE_DIR})
diff --git a/configure.ac b/configure.ac
index f9919d9..a4b4f18 100644
--- a/configure.ac
+++ b/configure.ac
@@ -660,7 +660,7 @@ AC_ARG_ENABLE(utils,
AM_CONDITIONAL(BUILD_UTILS, test x$enable_utils = xyes)
AC_ARG_ENABLE(compile-warnings,
- AC_HELP_STRING([--enable-compile-warnings=@<:@no/yes/kde@:>@]
+ AC_HELP_STRING([--enable-compile-warnings=@<:@no/yes/kde@:>@],
[Turn on compiler warnings.]),,
[enable_compile_warnings="yes"])
@@ -669,31 +669,30 @@ dnl Color Management
dnl
AC_ARG_ENABLE(cms,
- AC_HELP_STRING([--disable-cms],
- [Don't use color management system.]),
- enable_cms=$enableval,
- enable_cms="try")
-if test x$enable_cms = xyes; then
+ AC_HELP_STRING([--enable-cms=@<:@auto/lcms1/lcms2/none@:>@],
+ [Use color management system. 'auto' prefers lcms2 over lcms1 if both are available [[default=auto]]]),
+ [enable_cms=$enableval],
+ [enable_cms="auto"])
+if test x$enable_cms = xauto; then
PKG_CHECK_MODULES(LCMS, lcms2, [lcms2=yes], [lcms2=no])
if test x$lcms2 = xno; then
- PKG_CHECK_MODULES(LCMS, lcms)
- fi
-elif test x$enable_cms = xtry; then
- PKG_CHECK_MODULES(LCMS, lcms2,[lcms2=yes],[lcms2=no])
- if test x$lcms2 = xyes; then
- enable_cms=yes
- else
- PKG_CHECK_MODULES(LCMS, lcms,[enable_cms=yes],[enable_cms=no])
+ PKG_CHECK_MODULES(LCMS, lcms, [lcms1=yes], [lcms1=no])
fi
+elif test x$enable_cms = xlcms1; then
+ PKG_CHECK_MODULES(LCMS, lcms, [lcms1=yes], [lcms1=no])
+elif test x$enable_cms = xlcms2; then
+ PKG_CHECK_MODULES(LCMS, lcms2, [lcms2=yes], [lcms2=no])
fi
-if test "x$enable_cms" = "xyes"; then
+if test x$lcms1 = xyes || test x$lcms2 = xyes; then
+ enable_cms=yes
AC_DEFINE(USE_CMS, 1, [Defines if use cms])
- if test "x$lcms2" != "xyes"; then
+ if test x$lcms1 = xyes; then
lcms1=yes;
AC_DEFINE(USE_LCMS1, 1, [Defines if use lcms1])
fi
fi
+
AM_CONDITIONAL(USE_CMS, test x$enable_cms = xyes)
AM_CONDITIONAL(USE_LCMS1, test x$lcms1 = xyes)
More information about the poppler
mailing list