Commit e62e18e1 authored by Jehan Pagès's avatar Jehan Pagès Committed by Albert Astals Cid

poppler: use poppler-data pkg-config for both cmake and autotools builds

parent 572c6076
......@@ -232,6 +232,22 @@ if(LCMS2_FOUND)
include_directories(${LCMS2_INCLUDE_DIR})
endif(LCMS2_FOUND)
# Recent versions of poppler-data install a .pc file.
# Use it to determine the encoding data path, if available.
# Default to the same prefix otherwise.
pkg_check_modules(POPPLER_DATA poppler-data)
if(POPPLER_DATA_FOUND)
execute_process(COMMAND "${PKG_CONFIG_EXECUTABLE}" --variable=poppler_datadir poppler-data
RESULT_VARIABLE _result_var
OUTPUT_VARIABLE _output_var OUTPUT_STRIP_TRAILING_WHITESPACE)
if(_result_var STREQUAL "0" AND NOT _output_var STREQUAL "")
set(POPPLER_DATADIR "${_output_var}")
endif(_result_var STREQUAL "0" AND NOT _output_var STREQUAL "")
endif(POPPLER_DATA_FOUND)
if(NOT DEFINED POPPLER_DATADIR)
set(POPPLER_DATADIR "${CMAKE_INSTALL_PREFIX}/share/poppler")
endif(NOT DEFINED POPPLER_DATADIR)
if(DEFINED COMPILE_WARNINGS)
else(DEFINED COMPILE_WARNINGS)
set(COMPILE_WARNINGS "yes")
......
......@@ -169,7 +169,7 @@
#define PACKAGE_VERSION "${POPPLER_VERSION}"
/* Poppler data dir */
#define POPPLER_DATADIR "${CMAKE_INSTALL_PREFIX}/share/poppler"
#define POPPLER_DATADIR "${POPPLER_DATADIR}"
/* Support for curl based doc builder is compiled in. */
#cmakedefine POPPLER_HAS_CURL_SUPPORT 1
......
......@@ -105,7 +105,12 @@ if test x$enable_relocatable = xyes; then
fi
fi
AC_DEFINE_DIR(POPPLER_DATADIR, "{datarootdir}/poppler", [Poppler data dir])
dnl ##### Check for installed poppler-data. Use the same datarootdir as default otherwise.
PKG_CHECK_EXISTS(poppler-data,
[POPPLER_DATADIR=`$PKG_CONFIG --variable=poppler_datadir poppler-data`
AC_DEFINE_DIR(POPPLER_DATADIR, "{POPPLER_DATADIR}", [Poppler data dir])],
[AC_DEFINE_DIR(POPPLER_DATADIR, "{datarootdir}/poppler", [Poppler data dir])]
)
dnl ##### Checks for header files.
AC_PATH_XTRA
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment