[poppler] CMakeLists.txt config.h.cmake poppler/Gfx.cc poppler/GfxState.cc
Albert Astals Cid
aacid at kemper.freedesktop.org
Fri Dec 1 22:20:18 UTC 2017
CMakeLists.txt | 36 ++++++------------------------------
config.h.cmake | 3 ---
poppler/Gfx.cc | 5 -----
poppler/GfxState.cc | 40 ----------------------------------------
4 files changed, 6 insertions(+), 78 deletions(-)
New commits:
commit ce8e17e4fa96b7dd639c72818bba5a26c16cc1cb
Author: Albert Astals Cid <aacid at kde.org>
Date: Fri Dec 1 23:19:39 2017 +0100
Stop supporting lcms1, you really want to use lcms2 :)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3a34168f..20882cf0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,7 +51,7 @@ option(ENABLE_GTK_DOC "Whether to generate glib API documentation." OFF)
option(ENABLE_QT4 "Compile poppler qt4 wrapper." ON)
option(ENABLE_QT5 "Compile poppler qt5 wrapper." ON)
set(ENABLE_LIBOPENJPEG "auto" CACHE STRING "Use libopenjpeg for JPX streams. Possible values: auto, openjpeg1, openjpeg2, unmaintained, none. 'auto' prefers openjpeg2 over openjpeg1 if both are available. 'unmaintained' gives you the internal unmaintained decoder. Use at your own risk. 'none' compiles no JPX decoder at all. Default: auto")
-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.")
+set(ENABLE_CMS "lcms2" CACHE STRING "Use color management system. Possible values: lcms2. Unset to disable color management system.")
set(ENABLE_DCTDECODER "libjpeg" CACHE STRING "Use libjpeg for DCT streams. Possible values: libjpeg, unmaintained, none. will use libjpeg if available or fail if not. 'unmaintained' gives you the internal unmaintained decoder. Use at your own risk. 'none' compiles no DCT decoder at all. Default: libjpeg")
option(ENABLE_LIBCURL "Build libcurl based HTTP support." ON)
option(ENABLE_ZLIB "Build with zlib." ON)
@@ -243,21 +243,11 @@ else()
message(FATAL_ERROR "Invalid ENABLE_LIBOPENJPEG value: ${ENABLE_LIBOPENJPEG}")
endif()
set(ENABLE_LIBOPENJPEG "${WITH_OPENJPEG}")
-if(ENABLE_CMS STREQUAL "auto")
- find_package(LCMS2)
- set(USE_CMS ${LCMS2_FOUND})
- if(NOT LCMS2_FOUND)
- find_package(LCMS)
- set(USE_CMS ${LCMS_FOUND})
- set(USE_LCMS1 ${LCMS_FOUND})
- endif()
-elseif(ENABLE_CMS STREQUAL "lcms1")
- find_package(LCMS)
- set(USE_CMS ${LCMS_FOUND})
- set(USE_LCMS1 ${LCMS_FOUND})
-elseif(ENABLE_CMS STREQUAL "lcms2")
+if(ENABLE_CMS STREQUAL "lcms2")
find_package(LCMS2)
set(USE_CMS ${LCMS2_FOUND})
+elseif(NOT ENABLE_CMS STREQUAL "")
+ MESSAGE(FATAL_ERROR "ENABLE_CMS is not lcms2 nor empty")
endif()
if(ENABLE_LIBCURL)
find_package(CURL)
@@ -318,9 +308,6 @@ endif()
if(LIBOPENJPEG2_FOUND)
include_directories(${LIBOPENJPEG2_INCLUDE_DIRS})
endif()
-if(LCMS_FOUND)
- include_directories(${LCMS_INCLUDE_DIR})
-endif()
if(LCMS2_FOUND)
include_directories(${LCMS2_INCLUDE_DIR})
endif()
@@ -517,12 +504,7 @@ else ()
)
endif()
if(USE_CMS)
- if(LCMS_FOUND)
- set(poppler_LIBS ${poppler_LIBS} ${LCMS_LIBRARIES})
- endif()
- if(LCMS2_FOUND)
- set(poppler_LIBS ${poppler_LIBS} ${LCMS2_LIBRARIES})
- endif()
+ set(poppler_LIBS ${poppler_LIBS} ${LCMS2_LIBRARIES})
endif()
if(WIN32)
# use clean APIs
@@ -797,13 +779,7 @@ endif()
if(USE_OPENJPEG2)
message(" with openjpeg2")
endif()
-show_end_message_yesno("use cms" USE_CMS)
-if(LCMS_FOUND)
- message(" with lcms1")
-endif()
-if(LCMS2_FOUND)
- message(" with lcms2")
-endif()
+show_end_message_yesno("use lcms2" USE_CMS)
show_end_message_yesno("command line utils" ENABLE_UTILS)
show_end_message("test data dir" ${TESTDATADIR})
diff --git a/config.h.cmake b/config.h.cmake
index abebd6f2..03bebd7d 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -180,9 +180,6 @@
/* Use single precision arithmetic in the Splash backend */
#cmakedefine USE_FLOAT 1
-/* Defines if use lcms1 */
-#cmakedefine USE_LCMS1 1
-
/* Version number of package */
#define VERSION "${POPPLER_VERSION}"
diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc
index 63346a4c..531acbd4 100644
--- a/poppler/Gfx.cc
+++ b/poppler/Gfx.cc
@@ -630,12 +630,7 @@ Gfx::Gfx(PDFDoc *docA, OutputDev *outA, Dict *resDict,
#ifdef USE_CMS
-#ifdef USE_LCMS1
-#include <lcms.h>
-#else
#include <lcms2.h>
-#define LCMS_FLAGS cmsFLAGS_NOOPTIMIZE
-#endif
void Gfx::initDisplayProfile() {
Object catDict = xref->getCatalog();
diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
index 44a92813..3ad10381 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -179,40 +179,8 @@ static const char *gfxColorSpaceModeNames[] = {
static const std::map<unsigned int, unsigned int>::size_type CMSCACHE_LIMIT = 2048;
-#ifdef USE_LCMS1
-#include <lcms.h>
-#define cmsColorSpaceSignature icColorSpaceSignature
-#define cmsSetLogErrorHandler cmsSetErrorHandler
-#define cmsSigXYZData icSigXYZData
-#define cmsSigLuvData icSigLuvData
-#define cmsSigLabData icSigLabData
-#define cmsSigYCbCrData icSigYCbCrData
-#define cmsSigYxyData icSigYxyData
-#define cmsSigRgbData icSigRgbData
-#define cmsSigHsvData icSigHsvData
-#define cmsSigHlsData icSigHlsData
-#define cmsSigCmyData icSigCmyData
-#define cmsSig3colorData icSig3colorData
-#define cmsSigGrayData icSigGrayData
-#define cmsSigCmykData icSigCmykData
-#define cmsSig4colorData icSig4colorData
-#define cmsSig2colorData icSig2colorData
-#define cmsSig5colorData icSig5colorData
-#define cmsSig6colorData icSig6colorData
-#define cmsSig7colorData icSig7colorData
-#define cmsSig8colorData icSig8colorData
-#define cmsSig9colorData icSig9colorData
-#define cmsSig10colorData icSig10colorData
-#define cmsSig11colorData icSig11colorData
-#define cmsSig12colorData icSig12colorData
-#define cmsSig13colorData icSig13colorData
-#define cmsSig14colorData icSig14colorData
-#define cmsSig15colorData icSig15colorData
-#define LCMS_FLAGS 0
-#else
#include <lcms2.h>
#define LCMS_FLAGS cmsFLAGS_NOOPTIMIZE | cmsFLAGS_BLACKPOINTCOMPENSATION
-#endif
#define COLOR_PROFILE_DIR "/ColorProfiles/"
#define GLOBAL_COLOR_PROFILE_DIR POPPLER_DATADIR COLOR_PROFILE_DIR
@@ -498,18 +466,10 @@ cmsHPROFILE loadColorProfile(const char *fileName)
return hp;
}
-#ifdef USE_LCMS1
-static int CMSError(int ecode, const char *msg)
-{
- error(errSyntaxWarning, -1, "{0:s}", msg);
- return 1;
-}
-#else
static void CMSError(cmsContext /*contextId*/, cmsUInt32Number /*ecode*/, const char *text)
{
error(errSyntaxWarning, -1, "{0:s}", text);
}
-#endif
int GfxColorSpace::setupColorProfiles()
{
More information about the poppler
mailing list