Commit 71615eaa authored by Atsuhito Kohda's avatar Atsuhito Kohda

Imported Debian patch 0.5~svn1288-1

parents 685bc89e 211ec79e
Release 0.4.5 (TL'13) [April 2013]
* Fix "Restore defaults" in preferences dialog
* Fix removal and selection of text moved via drag'n'drop
* Fix default saving location
* Keep UTF-8 BOMs in files that have them
* Make "Goto Source" lead to the last active source window
* Implement close button for the console output panel
* Implement "Open PDF with TeX" option
* Improve compatibility with OS color schemes
* New encoding support for "Mac Central European Roman"
* Code cleanup
* Updated log parser (improve handling of long messages and file paths)
* New script properties/functions: cursorPosition, getEngineList()
Release 0.4.4 (TL'12) [April 2012]
* Fix crash caused by Qt when adding lines at the beginning of a document
* Fix search/replace for multi-line strings
......
......@@ -29,7 +29,7 @@ Mailing list: http://tug.org/mailman/listinfo/texworks
License
=======
TeXworks is copyright (C) 2007-2012 by Jonathan Kew, Stefan Löffler, and Charlie
TeXworks is copyright (C) 2007-2013 by Jonathan Kew, Stefan Löffler, and Charlie
Sharpsteen. Distributed under the terms of the GNU General Public License,
version 2 or (at your option) any later version.
See the file COPYING for details.
......
......@@ -51,7 +51,7 @@
<key>CFBundleIconFile</key>
<string>TeXworks.icns</string>
<key>CFBundleGetInfoString</key>
<string>TeXworks version @VER@ (r.@REV@)&#xA;(C) 2007-2012 Jonathan Kew, Stefan L&#xF6;ffler, Charlie Sharpsteen&#xA;Released under GPL (v2.0 or later)</string>
<string>TeXworks version @VER@ (r.@REV@)&#xA;(C) 2007-2013 Jonathan Kew, Stefan L&#xF6;ffler, Charlie Sharpsteen&#xA;Released under GPL (v2.0 or later)</string>
<key>CFBundleExecutable</key>
<string>TeXworks</string>
<key>CFBundleIdentifier</key>
......@@ -68,5 +68,9 @@
<string>@VER@ (r.@REV@)</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSHighResolutionCapable</key>
<true/>
</dict>
</plist>
texworks (0.5~svn1288-1) unstable; urgency=low
* New Upstream Release (rev 1288).
* Fixed rules clean target. obj -> objs
* Fixed control file. Added zlib1g-dev to Build-Depends field.
(Closes: #710102)
-- Atsuhito KOHDA <kohda@debian.org> Tue, 04 Jun 2013 14:11:27 +0900
texworks (0.5~svn1035-1) unstable; urgency=low
* New Upstream Release (rev 1035).
......
......@@ -2,7 +2,7 @@ Source: texworks
Section: editors
Priority: extra
Maintainer: Atsuhito KOHDA <kohda@debian.org>
Build-Depends: debhelper (>= 7), libhunspell-dev, qt4-dev-tools, libpoppler-qt4-dev, libdbus-1-dev, liblua5.1-0-dev, python-dev
Build-Depends: debhelper (>= 7), libhunspell-dev, qt4-dev-tools, libpoppler-qt4-dev, libdbus-1-dev, liblua5.1-0-dev, python-dev, zlib1g-dev
Standards-Version: 3.8.3
Homepage: http://www.tug.org/texworks/
......
......@@ -64,17 +64,17 @@ clean:
if [ -f Makefile ]; then $(MAKE) clean; fi
rm -f ./texworks ./Makefile src/DefaultBinaryPaths.h
if [ -d moc ]; then rmdir moc; fi
if [ -d obj ]; then rmdir obj; fi
if [ -d objs ]; then rmdir objs; fi
if [ -d rcc ]; then rmdir rcc; fi
if [ -d ui ]; then rmdir ui; fi
if [ -f $(PLIDIR)/Makefile ]; then cd $(PLIDIR) && $(MAKE) clean; fi
if [ -d $(PLIDIR)/moc ]; then rmdir $(PLIDIR)/moc; fi
if [ -d $(PLIDIR)/obj ]; then rmdir $(PLIDIR)/obj; fi
if [ -d $(PLIDIR)/objs ]; then rmdir $(PLIDIR)/objs; fi
if [ -d $(PLIDIR)/rcc ]; then rmdir $(PLIDIR)/rcc; fi
if [ -d $(PLIDIR)/ui ]; then rmdir $(PLIDIR)/ui; fi
if [ -f $(PLIPYT)/Makefile ]; then cd $(PLIPYT) && $(MAKE) clean; fi
if [ -d $(PLIPYT)/moc ]; then rmdir $(PLIPYT)/moc; fi
if [ -d $(PLIPYT)/obj ]; then rmdir $(PLIPYT)/obj; fi
if [ -d $(PLIPYT)/objs ]; then rmdir $(PLIPYT)/objs; fi
if [ -d $(PLIPYT)/rcc ]; then rmdir $(PLIPYT)/rcc; fi
if [ -d $(PLIPYT)/ui ]; then rmdir $(PLIPYT)/ui; fi
patch -NRp1 < ./debian/patch-py || true
......
......@@ -74,6 +74,7 @@ case $PLATFORM in
*) OS=`echo $PLATFORM | sed 's/.*-//'`
esac
appendPath "/usr/local/texlive/2013/bin/$ARCH-$OS"
appendPath "/usr/local/texlive/2012/bin/$ARCH-$OS"
appendPath "/usr/local/texlive/2011/bin/$ARCH-$OS"
appendPath "/usr/local/texlive/2010/bin/$ARCH-$OS"
......
......@@ -69,7 +69,7 @@ If you find a bug, please report it at \%http://code.google.com/p/texworks/issue
Jonathan Kew, Stefan Löffler, Charlie Sharpsteen, and others
.SH COPYRIGHT
Copyright (C) 2007-2012 Jonathan Kew, Stefan Löffler, Charlie Sharpsteen
Copyright (C) 2007-2013 Jonathan Kew, Stefan Löffler, Charlie Sharpsteen
License GPLv2+: GNU GPL (version 2 or later) <http://gnu.org/licenses/gpl.html>
......
*.o
icons.cpp
pdf_viewer
unit-tests/*_test
# - Try to find Fontconfig
# Once done this will define
#
# FONTCONFIG_FOUND - system has Fontconfig
# FONTCONFIG_INCLUDE_DIR - the Fontconfig include directory
# FONTCONFIG_LIBRARIES - Link these to use Fontconfig
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
if ( FONTCONFIG_INCLUDE_DIR AND FONTCONFIG_LIBRARIES )
# in cache already
SET(Fontconfig_FIND_QUIETLY TRUE)
endif ( FONTCONFIG_INCLUDE_DIR AND FONTCONFIG_LIBRARIES )
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
if( NOT WIN32 )
find_package(PkgConfig)
pkg_check_modules(FONTCONFIG_PKG QUIET fontconfig)
endif( NOT WIN32 )
FIND_PATH(FONTCONFIG_INCLUDE_DIR NAMES fontconfig/fontconfig.h
PATHS
/usr/local/include
/usr/X11/include
/usr/include
HINTS
${FONTCONFIG_PKG_INCLUDE_DIRS} # Generated by pkg-config
)
FIND_LIBRARY(FONTCONFIG_LIBRARIES NAMES fontconfig ${FONTCONFIG_PKG_LIBRARIES}
PATHS
/usr/local
/usr/X11
/usr
HINTS
${FONTCONFIG_PKG_LIBRARY_DIRS} # Generated by pkg-config
PATH_SUFFIXES
lib64
lib
)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Fontconfig DEFAULT_MSG FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR )
# show the FONTCONFIG_INCLUDE_DIR and FONTCONFIG_LIBRARIES variables only in the advanced view
MARK_AS_ADVANCED(FONTCONFIG_INCLUDE_DIR FONTCONFIG_LIBRARIES )
# - Try to find JBig2Dec
# Once done this will define
#
# JBIG2DEC_FOUND - system has JBig2Dec
# JBIG2DEC_INCLUDE_DIR - The include directory for JBig2Dec headers
# JBIG2DEC_LIBRARIES - Link these to use JBig2Dec
#
# Redistribution and use is allowed according to the terms of the BSD license.
#
if ( JBIG2DEC_LIBRARIES )
# in cache already
SET(JBig2Dec_FIND_QUIETLY TRUE)
endif ( JBIG2DEC_LIBRARIES )
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
if( NOT WIN32 )
find_package(PkgConfig)
pkg_check_modules(JBIG2DEC_PKG QUIET jbig2dec)
endif( NOT WIN32 )
# Find libjbig2dec and associated header files (Required)
FIND_LIBRARY(JBIG2DEC_LIBRARIES NAMES jbig2dec
PATHS
/usr/local
/usr
HINTS
${JBIG2DEC_PKG_LIBRARY_DIRS} # Generated by pkg-config
PATH_SUFFIXES
lib64
lib
)
IF ( NOT(JBIG2DEC_LIBRARIES) )
MESSAGE(STATUS "Could not find JBig2Dec library." )
ENDIF()
FIND_PATH(JBIG2DEC_INCLUDE_DIR NAMES jbig2.h
PATHS
/usr/local/include
/usr/include
HINTS
${JBIG2DEC_PKG_INCLUDE_DIRS} # Generated by pkg-config
PATH_SUFFIXES
openjpeg-1.4
)
IF ( NOT(JBIG2DEC_INCLUDE_DIR) )
MESSAGE(STATUS "Could not find JBig2Dec headers." )
ENDIF ()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(JBig2Dec DEFAULT_MSG JBIG2DEC_LIBRARIES JBIG2DEC_INCLUDE_DIR )
# show the JBIG2DEC_(XPDF/QT4)_INCLUDE_DIR and JBIG2DEC_LIBRARIES variables only in the advanced view
MARK_AS_ADVANCED(JBIG2DEC_INCLUDE_DIR JBIG2DEC_LIBRARIES)
# - Try to find MuPDF
# Once done this will define
#
# MUPDF_FOUND - system has MuPDF
# MUPDF_INCLUDE_DIR - The include directory for MuPDF headers
# MUPDF_LIBRARIES - Link these to use MuPDF
#
# Redistribution and use is allowed according to the terms of the BSD license.
#
if ( MUPDF_LIBRARIES )
# in cache already
SET(MuPDF_FIND_QUIETLY TRUE)
endif ( MUPDF_LIBRARIES )
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig)
if( PKG_CONFIG_FOUND )
pkg_check_modules(MUPDF_PKG QUIET mupdf)
endif( PKG_CONFIG_FOUND )
# Find libmupdf, libfitz and associated header files (Required)
FIND_LIBRARY(MUPDF_LIBRARY NAMES mupdf
PATHS
/usr/local
/usr
HINTS
${MUPDF_PKG_LIBRARY_DIRS} # Generated by pkg-config
PATH_SUFFIXES
lib64
lib
)
FIND_LIBRARY(FITZ_LIBRARY NAMES fitz
PATHS
/usr/local
/usr
HINTS
${MUPDF_PKG_LIBRARY_DIRS} # Generated by pkg-config
PATH_SUFFIXES
lib64
lib
)
MARK_AS_ADVANCED(MUPDF_LIBRARY)
MARK_AS_ADVANCED(FITZ_LIBRARY)
IF ( NOT(MUPDF_LIBRARY) OR NOT(FITZ_LIBRARY) )
MESSAGE(STATUS "Could not find MuPDF libraries." )
ELSE()
SET(MUPDF_LIBRARIES ${MUPDF_LIBRARY} ${FITZ_LIBRARY})
ENDIF()
FIND_PATH(MUPDF_INCLUDE_DIR NAMES mupdf.h
PATHS
/usr/local/include
/usr/include
HINTS
${MUPDF_PKG_INCLUDE_DIRS} # Generated by pkg-config
)
IF ( NOT(MUPDF_INCLUDE_DIR) )
MESSAGE(STATUS "Could not find MuPDF headers." )
ENDIF ()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(MuPDF DEFAULT_MSG MUPDF_LIBRARIES MUPDF_INCLUDE_DIR )
# show the MUPDF_(XPDF/QT4)_INCLUDE_DIR and MUPDF_LIBRARIES variables only in the advanced view
MARK_AS_ADVANCED(MUPDF_INCLUDE_DIR MUPDF_LIBRARIES)
# - Try to find OpenJPEG
# Once done this will define
#
# OPENJPEG_FOUND - system has OpenJPEG
# OPENJPEG_INCLUDE_DIR - The include directory for OpenJPEG headers
# OPENJPEG_LIBRARIES - Link these to use OpenJPEG
#
# Redistribution and use is allowed according to the terms of the BSD license.
#
if ( OPENJPEG_LIBRARIES )
# in cache already
SET(OpenJPEG_FIND_QUIETLY TRUE)
endif ( OPENJPEG_LIBRARIES )
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
if( NOT WIN32 )
find_package(PkgConfig)
pkg_check_modules(OPENJPEG_PKG QUIET openjpeg)
endif( NOT WIN32 )
# Find libopenjpeg and associated header files (Required)
FIND_LIBRARY(OPENJPEG_LIBRARIES NAMES openjpeg
PATHS
/usr/local
/usr
HINTS
${OPENJPEG_PKG_LIBRARY_DIRS} # Generated by pkg-config
PATH_SUFFIXES
lib64
lib
)
IF ( NOT(OPENJPEG_LIBRARIES) )
MESSAGE(STATUS "Could not find OpenJPEG library." )
ENDIF()
FIND_PATH(OPENJPEG_INCLUDE_DIR NAMES openjpeg.h
PATHS
/usr/local/include
/usr/include
HINTS
${OPENJPEG_PKG_INCLUDE_DIRS} # Generated by pkg-config
PATH_SUFFIXES
openjpeg-1.4
)
IF ( NOT(OPENJPEG_INCLUDE_DIR) )
MESSAGE(STATUS "Could not find OpenJPEG headers." )
ENDIF ()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenJPEG DEFAULT_MSG OPENJPEG_LIBRARIES OPENJPEG_INCLUDE_DIR )
# show the OPENJPEG_(XPDF/QT4)_INCLUDE_DIR and OPENJPEG_LIBRARIES variables only in the advanced view
MARK_AS_ADVANCED(OPENJPEG_INCLUDE_DIR OPENJPEG_LIBRARIES)
# - Try to find Poppler and Poppler-Qt4
# Once done this will define
#
# POPPLER_FOUND - system has Poppler and Poppler-Qt4
# POPPLER_HAS_XPDF - A boolean indicating if Poppler XPDF headers are available
# POPPLER_NEEDS_FONTCONFIG - A boolean indicating if libpoppler depends on libfontconfig
# POPPLER_XPDF_INCLUDE_DIR - the include directory for Poppler XPDF headers
# POPPLER_QT4_INCLUDE_DIR - the include directory for Poppler-Qt4 headers
# POPPLER_QT4_LIBRARIES - Link this to use only libpoppler-Qt4
# POPPLER_LIBRARIES - Link these to use Poppler and Poppler-Qt4
#
# Note: the Poppler-cpp include directory is currently not needed by TeXworks
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
if ( POPPLER_LIBRARIES )
# in cache already
SET(Poppler_FIND_QUIETLY TRUE)
endif ( POPPLER_LIBRARIES )
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig)
if( PKG_CONFIG_FOUND )
pkg_check_modules(POPPLER_PKG QUIET poppler)
pkg_check_modules(POPPLER_QT4_PKG QUIET poppler-qt4)
endif( PKG_CONFIG_FOUND )
# Check for Poppler XPDF headers (optional)
FIND_PATH(POPPLER_XPDF_INCLUDE_DIR NAMES poppler-config.h
PATHS
/usr/local/include
/usr/include
HINTS
${POPPLER_PKG_INCLUDE_DIRS} # Generated by pkg-config
PATH_SUFFIXES poppler
)
IF( NOT(POPPLER_XPDF_INCLUDE_DIR) )
MESSAGE( STATUS "Could not find poppler-config.h, disabling support for Xpdf headers." )
SET( POPPLER_HAS_XPDF false )
ELSE( NOT(POPPLER_XPDF_INCLUDE_DIR) )
SET( POPPLER_HAS_XPDF true )
ENDIF( NOT(POPPLER_XPDF_INCLUDE_DIR) )
# Find libpoppler, libpoppler-qt4 and associated header files (Required)
FIND_LIBRARY(POPPLER_LIBRARIES NAMES poppler ${POPPLER_PKG_LIBRARIES}
PATHS
/usr/local
/usr
HINTS
${POPPLER_PKG_LIBRARY_DIRS} # Generated by pkg-config
PATH_SUFFIXES
lib64
lib
)
IF ( NOT(POPPLER_LIBRARIES) )
MESSAGE(STATUS "Could not find libpoppler." )
ENDIF ()
# Scan poppler libraries for dependencies on Fontconfig
INCLUDE(GetPrerequisites)
MARK_AS_ADVANCED(gp_cmd)
GET_PREREQUISITES("${POPPLER_LIBRARIES}" POPPLER_PREREQS TRUE FALSE "" "")
IF ("${POPPLER_PREREQS}" MATCHES "fontconfig")
SET(POPPLER_NEEDS_FONTCONFIG TRUE)
ELSE ()
SET(POPPLER_NEEDS_FONTCONFIG FALSE)
ENDIF ()
FIND_PATH(POPPLER_QT4_INCLUDE_DIR NAMES poppler-qt4.h poppler-link.h
PATHS
/usr/local/include
/usr/include
HINTS
${POPPLER_QT4_PKG_INCLUDE_DIRS} # Generated by pkg-config
PATH_SUFFIXES
poppler/qt4
)
IF ( NOT(POPPLER_QT4_INCLUDE_DIR) )
MESSAGE(STATUS "Could not find Poppler-Qt4 headers." )
ENDIF ()
FIND_LIBRARY(POPPLER_QT4_LIBRARIES NAMES poppler-qt4 ${POPPLER_QT4_PKG_LIBRARIES}
PATHS
/usr/local
/usr
HINTS
${POPPLER_PKG_LIBRARY_DIRS} # Generated by pkg-config
PATH_SUFFIXES
lib64
lib
)
MARK_AS_ADVANCED(POPPLER_QT4_LIBRARIES)
IF ( NOT(POPPLER_QT4_LIBRARIES) )
MESSAGE(STATUS "Could not find libpoppler-qt4." )
ENDIF ()
# Prepend poppler-qt4 library---in case of static linking, poppler-qt4 must come
# first
LIST(INSERT POPPLER_LIBRARIES 0 ${POPPLER_QT4_LIBRARIES})
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Poppler DEFAULT_MSG POPPLER_LIBRARIES POPPLER_QT4_INCLUDE_DIR )
# show the POPPLER_(XPDF/QT4)_INCLUDE_DIR and POPPLER_LIBRARIES variables only in the advanced view
MARK_AS_ADVANCED(POPPLER_XPDF_INCLUDE_DIR POPPLER_QT4_INCLUDE_DIR POPPLER_LIBRARIES)
# Adapted from CMake 2.8 QT4_CREATE_TRANSLATION
# TODO: Find a better name for this
MACRO(CREATE_QT4_PRO_FILE _pro_path _qm_res)
QT4_EXTRACT_OPTIONS(_lupdate_files _lupdate_options ${ARGN})
SET(_my_sources)
SET(_my_dirs)
SET(_my_tsfiles)
SET(_ts_pro)
GET_FILENAME_COMPONENT(_pro_basepath ${_pro_path} PATH)
FOREACH (_file ${_lupdate_files})
GET_FILENAME_COMPONENT(_ext ${_file} EXT)
GET_FILENAME_COMPONENT(_abs_FILE ${_file} ABSOLUTE)
IF(_ext MATCHES "ts")
LIST(APPEND _my_tsfiles ${_abs_FILE})
ELSE(_ext MATCHES "ts")
IF(NOT _ext)
LIST(APPEND _my_dirs ${_abs_FILE})
ELSE(NOT _ext)
LIST(APPEND _my_sources ${_abs_FILE})
ENDIF(NOT _ext)
ENDIF(_ext MATCHES "ts")
ENDFOREACH(_file)
# Construct the .pro file
# It includes SOURCES and TRANSLATIONS settings, but nothing else.
SET(_pro_content "# WARNING: This file was generated automatically by CMake.\n\nerror(\"This file is not intended for building ${CMAKE_PROJECT_NAME}. Please use CMake instead. See the README for further instructions.\")")
IF(_my_sources)
SET(_pro_content "${_pro_content}\n\nSOURCES =")
FOREACH(_pro_src ${_my_sources})
FILE(RELATIVE_PATH _pro_src ${_pro_basepath} ${_pro_src})
SET(_pro_content "${_pro_content} \\\n\"${_pro_src}\"")
ENDFOREACH(_pro_src ${_my_sources})
ENDIF(_my_sources)
IF(_my_tsfiles)
SET(_pro_content "${_pro_content}\n\nTRANSLATIONS =")
FOREACH(_pro_ts ${_my_tsfiles})
FILE(RELATIVE_PATH _pro_ts ${_pro_basepath} ${_pro_ts})
SET(_pro_content "${_pro_content} \\\n\"${_pro_ts}\"")
ENDFOREACH(_pro_ts ${_my_tsfiles})
ENDIF(_my_tsfiles)
FILE(WRITE ${_pro_path} "${_pro_content}\n")
# Ensure the .qm files are generated in the build tree
FOREACH(_ts_file ${_my_tsfiles})
GET_FILENAME_COMPONENT(_ts_path ${_ts_file} PATH)
FILE(RELATIVE_PATH _ts_path ${CMAKE_CURRENT_SOURCE_DIR} ${_ts_path})
SET(_ts_path "${CMAKE_CURRENT_BINARY_DIR}/${_ts_path}")
SET_SOURCE_FILES_PROPERTIES(${_ts_file} PROPERTIES OUTPUT_LOCATION ${_ts_path})
ENDFOREACH(_ts_file ${_my_tsfiles})
# Add the translations
QT4_ADD_TRANSLATION(_qm_files ${_my_tsfiles})
# Construct an appropriate resource file
SET(_qm_qrc "<!DOCTYPE RCC>\n<RCC version=\"1.0\">\n<qresource>\n")
FOREACH(_qm_file ${_qm_files})
FILE(RELATIVE_PATH _qm_file ${CMAKE_CURRENT_BINARY_DIR} ${_qm_file})
SET(_qm_qrc "${_qm_qrc}<file>${_qm_file}</file>\n")
ENDFOREACH(_qm_file ${_qm_files})
SET(_qm_qrc "${_qm_qrc}</qresource>\n</RCC>\n")
SET(_qm_qrc_path ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_trans.qrc)
FILE(WRITE ${_qm_qrc_path} ${_qm_qrc})
QT4_ADD_RESOURCES(${_qm_res} ${_qm_qrc_path})
ENDMACRO(CREATE_QT4_PRO_FILE)
# Setup and User Options
# ======================
# Set project name.
PROJECT(QtPDF)
# We require CMake v2.8 or greater because we don't do any testing with earlier
# versions.
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
SET(CMAKE_COLOR_MAKEFILE ON)
# Always add the current source and binary directories to the header include
# path when compiling.
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
# Determine Version Numbers
# -------------------------
set(PROJECT_VERSION "0.1")
# Declare Project Options
# -----------------------
# For now, default to a debug build.
IF ( NOT CMAKE_BUILD_TYPE )
SET(CMAKE_BUILD_TYPE "Debug")
ENDIF ()
# By default, we build a shared lib...
IF ( NOT DEFINED BUILD_SHARED_LIBS )
SET(BUILD_SHARED_LIBS ON)
ENDIF ()
# ...with poppler-qt4...
IF ( NOT DEFINED WITH_POPPLERQT4 )
SET(WITH_POPPLERQT4 ON)
ENDIF ()
# ...but without MuPDF
IF ( NOT DEFINED WITH_MUPDF )
SET(WITH_MUPDF OFF)
ENDIF ()
OPTION(WITH_POPPLER "Build Poppler Qt4 backend" ${WITH_POPPLERQT4})
# MuPDF backend is a bit immature, so we don't bother with it by default right
# now.
OPTION(WITH_MUPDF "Build MuPDF backend" ${WITH_MUPDF})
OPTION(BUILD_SHARED_LIBS "Build shared library" ${BUILD_SHARED_LIBS})
# Dependency Configuration
# ========================
# Make the contents of `CMake/Modules` available. Among other things, this
# directory contains scripts that locate project components such as Poppler.
LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake/Modules)
# Core Components
# ---------------
# Declare Qt libraries required by this project.
SET (QT_COMPONENTS
QtCore
QtGui
QtXML
)
# Locate Qt. `INCLUDE(UseQt4)` brings in a set of macros that helps us deal
# with Qt-specific tasks such as compiling resources or running `moc`.
#
# Qt 4.6.0 or newer is required for many pieces of functionality used in the
# code.
FIND_PACKAGE(Qt4 4.6.0 COMPONENTS ${QT_COMPONENTS} REQUIRED)
INCLUDE(UseQt4)
FIND_PACKAGE(ZLIB REQUIRED)
# Aggregate library names and include directories into variables for easy
# access.
SET(QTPDF_INCLUDE_DIRS
${QT_INCLUDE_DIR}
${ZLIB_INCLUDE_DIR}
)
SET(QTPDF_LIBS
${QT_LIBRARIES}
${ZLIB_LIBRARIES}
)
# Backend Components
# ------------------
IF( WITH_POPPLERQT4 )
FIND_PACKAGE(Poppler REQUIRED)
LIST(APPEND QTPDF_INCLUDE_DIRS ${POPPLER_QT4_INCLUDE_DIR})
# In case poppler is linked statically, its libs have to be given to the
# linker **first** for some strange reason or symbols won't be properly
# resolved. At least, this is the case with the MinGW linker.
SET(QTPDF_LIBS ${POPPLER_LIBRARIES} ${QTPDF_LIBS})
# The only thing Poppler should need is the location of the include
# directories in order to access header files. The library loader should be
# able to find libfontconfig on standard search paths.
IF ( POPPLER_NEEDS_FONTCONFIG )
FIND_PACKAGE(Fontconfig REQUIRED)
LIST(APPEND QTPDF_INCLUDE_DIRS ${FONTCONFIG_INCLUDE_DIR})
ENDIF ()
ENDIF()
IF( WITH_MUPDF )
FIND_PACKAGE(JPEG REQUIRED)
FIND_PACKAGE(Freetype REQUIRED)
FIND_PACKAGE(JBig2Dec REQUIRED)
FIND_PACKAGE(OpenJPEG REQUIRED)
FIND_PACKAGE(MuPDF REQUIRED)
LIST(APPEND QTPDF_INCLUDE_DIRS
${JPEG_INCLUDE_DIR}
${FREETYPE_INCLUDE_DIR}
${JBIG2DEC_INCLUDE_DIR}
${OPENJPEG_INCLUDE_DIR}
${MUPDF_INCLUDE_DIR}