CMakeLists.txt | 66 ++++++++++++++++++++++++-------------- cmake/modules/PopplerMacros.cmake | 11 ++++-- 2 files changed, 51 insertions(+), 26 deletions(-)
New commits: commit cf07a5d85b402b6956c9605fbdc88bddcb94a3cf Author: Pino Toscano <[email protected]> Date: Sun Mar 7 00:49:07 2010 +0100 [CMake] show end yes/no message about the GDK usage just like done with autotools diff --git a/CMakeLists.txt b/CMakeLists.txt index ce5f742..18366a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -514,6 +514,7 @@ show_end_message_yesno("abiword output" ENABLE_ABIWORD) show_end_message_yesno("qt wrapper" QT3_FOUND) show_end_message_yesno("qt4 wrapper" QT4_FOUND) show_end_message_yesno("glib wrapper" GLIB_FOUND) +show_end_message_yesno(" use GDK" POPPLER_WITH_GDK) # message(" use gtk-doc: $enable_gtk_doc") # TODO show_end_message_yesno("cpp wrapper" ENABLE_CPP) show_end_message_yesno("use libjpeg" ENABLE_LIBJPEG) commit 42c98f8eabe304d5e3dc8c1ebdd5b0b6c221e696 Author: Pino Toscano <[email protected]> Date: Sat Mar 6 17:18:08 2010 +0100 [CMake] make the font configuration backend selection take a string (like with autotools) this way it is possible to set the cmake variable FONT_CONFIGURATION to either "win32" (default on windows) or "fontconfig" (default elsewhere) to the font backend to use as a consequence, make fontconfig a requirement only if the font backend chosen is "fontconfig" diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f497fa..ce5f742 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,13 +32,6 @@ option(ENABLE_ZLIB "TODO" OFF) option(USE_EXCEPTIONS "Throw exceptions to deal with not enough memory and similar problems." OFF) option(USE_FIXEDPOINT "Use fixed point arithmetic in the Splash backend" OFF) option(USE_FLOAT "Use single precision arithmetic in the Splash backend" OFF) -if(MSVC) - option(WITH_FONTCONFIGURATION_WIN32 "Select win32 font configuration backend" ON) - option(WITH_FONTCONFIGURATION_FONTCONFIG "Select fontconfig font configuration backend" OFF) -else(MSVC) - option(WITH_FONTCONFIGURATION_WIN32 "Select win32 font configuration backend" OFF) - option(WITH_FONTCONFIGURATION_FONTCONFIG "Select fontconfig font configuration backend" ON) -endif(MSVC) if(WIN32) option(ENABLE_RELOCATABLE "Hardcode the poppler library location (on Windows)." ON) else(WIN32) @@ -47,6 +40,23 @@ endif(WIN32) set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)") +if(WIN32) + set(_default_fontconfiguration "win32") +else(WIN32) + set(_default_fontconfiguration "fontconfig") +endif(WIN32) +set(FONT_CONFIGURATION "${_default_fontconfiguration}" CACHE STRING "The font configuration backend (win32|fontconfig).") +string(TOLOWER "${FONT_CONFIGURATION}" font_configuration) +if(font_configuration STREQUAL "win32") + set(WITH_FONTCONFIGURATION_WIN32 ON) + set(WITH_FONTCONFIGURATION_FONTCONFIG OFF) +elseif(font_configuration STREQUAL "fontconfig") + set(WITH_FONTCONFIGURATION_WIN32 OFF) + set(WITH_FONTCONFIGURATION_FONTCONFIG ON) +else(font_configuration STREQUAL "win32") + message(FATAL_ERROR "Invalid font configuration setting: ${FONT_CONFIGURATION}") +endif(font_configuration STREQUAL "win32") + # Enable these unconditionally. set(MULTITHREADED ON) set(OPI_SUPPORT ON) @@ -59,7 +69,9 @@ set(CAIRO_VERSION "1.8.4") macro_bool_to_01(ENABLE_SPLASH HAVE_SPLASH) find_package(Freetype REQUIRED) -find_package(Fontconfig REQUIRED) +if(WITH_FONTCONFIGURATION_FONTCONFIG) + find_package(Fontconfig REQUIRED) +endif(WITH_FONTCONFIGURATION_FONTCONFIG) macro_optional_find_package(JPEG) macro_optional_find_package(PNG) if(JPEG_FOUND) @@ -102,7 +114,10 @@ if(ENABLE_LCMS) set(USE_CMS ${LCMS_FOUND}) endif(ENABLE_LCMS) -add_definitions(-DHAVE_CONFIG_H=1 ${FONTCONFIG_DEFINITIONS}) +add_definitions(-DHAVE_CONFIG_H=1) +if(FONTCONFIG_FOUND) + add_definitions(${FONTCONFIG_DEFINITIONS}) +endif(FONTCONFIG_FOUND) include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/fofi @@ -228,7 +243,7 @@ set(poppler_SRCS poppler/XpdfPluginAPI.cc poppler/Movie.cc ) -set(poppler_LIBS ${FREETYPE_LIBRARIES} ${FONTCONFIG_LIBRARIES}) +set(poppler_LIBS ${FREETYPE_LIBRARIES}) if(ENABLE_SPLASH) set(poppler_SRCS ${poppler_SRCS} poppler/SplashOutputDev.cc @@ -253,6 +268,9 @@ if(ENABLE_SPLASH) splash/SplashXPathScanner.cc ) endif(ENABLE_SPLASH) +if(FONTCONFIG_FOUND) + set(poppler_LIBS ${poppler_LIBS} ${FONTCONFIG_LIBRARIES}) +endif(FONTCONFIG_FOUND) if(JPEG_FOUND) set(poppler_SRCS ${poppler_SRCS} poppler/DCTStream.cc @@ -489,6 +507,7 @@ endif(ENABLE_CPP) message("Building Poppler with support for:") +show_end_message("font configuration" ${font_configuration}) show_end_message_yesno("splash output" ENABLE_SPLASH) show_end_message_yesno("cairo output" CAIRO_FOUND) show_end_message_yesno("abiword output" ENABLE_ABIWORD) commit bda6e7cd089f2970af2e9540b4415633ffcf0ebb Author: Pino Toscano <[email protected]> Date: Sat Mar 6 17:13:30 2010 +0100 [CMake] add a show_end_message() macro to show a generic string as value make show_end_message_yesno() call it with the proper "yes" or "no" string diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake index aa54311..0495777 100644 --- a/cmake/modules/PopplerMacros.cmake +++ b/cmake/modules/PopplerMacros.cmake @@ -49,20 +49,25 @@ macro(POPPLER_CREATE_INSTALL_PKGCONFIG generated_file install_location) endif(NOT WIN32) endmacro(POPPLER_CREATE_INSTALL_PKGCONFIG) -macro(SHOW_END_MESSAGE_YESNO what enabled) +macro(SHOW_END_MESSAGE what value) string(LENGTH ${what} length_what) math(EXPR left_char "20 - ${length_what}") set(blanks) foreach(_i RANGE 1 ${left_char}) set(blanks "${blanks} ") endforeach(_i) + + message(" ${what}:${blanks} ${value}") +endmacro(SHOW_END_MESSAGE) + +macro(SHOW_END_MESSAGE_YESNO what enabled) if(${enabled}) set(enabled_string "yes") else(${enabled}) set(enabled_string "no") endif(${enabled}) - message(" ${what}:${blanks} ${enabled_string}") + show_end_message("${what}" "${enabled_string}") endmacro(SHOW_END_MESSAGE_YESNO) commit d313c0f508711b3b7166b84608c43ebf1f07194b Author: Pino Toscano <[email protected]> Date: Sat Mar 6 17:08:59 2010 +0100 [CMake] rename the show_end_message() macro to show_end_message_yesno() diff --git a/CMakeLists.txt b/CMakeLists.txt index 299b479..7f497fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -489,20 +489,20 @@ endif(ENABLE_CPP) message("Building Poppler with support for:") -show_end_message("splash output" ENABLE_SPLASH) -show_end_message("cairo output" CAIRO_FOUND) -show_end_message("abiword output" ENABLE_ABIWORD) -show_end_message("qt wrapper" QT3_FOUND) -show_end_message("qt4 wrapper" QT4_FOUND) -show_end_message("glib wrapper" GLIB_FOUND) +show_end_message_yesno("splash output" ENABLE_SPLASH) +show_end_message_yesno("cairo output" CAIRO_FOUND) +show_end_message_yesno("abiword output" ENABLE_ABIWORD) +show_end_message_yesno("qt wrapper" QT3_FOUND) +show_end_message_yesno("qt4 wrapper" QT4_FOUND) +show_end_message_yesno("glib wrapper" GLIB_FOUND) # message(" use gtk-doc: $enable_gtk_doc") # TODO -show_end_message("cpp wrapper" ENABLE_CPP) -show_end_message("use libjpeg" ENABLE_LIBJPEG) -show_end_message("use libpng" ENABLE_LIBPNG) -show_end_message("use zlib" ENABLE_ZLIB) -show_end_message("use libopenjpeg" LIBOPENJPEG_FOUND) -show_end_message("use cms" USE_CMS) -show_end_message("command line utils" ENABLE_UTILS) +show_end_message_yesno("cpp wrapper" ENABLE_CPP) +show_end_message_yesno("use libjpeg" ENABLE_LIBJPEG) +show_end_message_yesno("use libpng" ENABLE_LIBPNG) +show_end_message_yesno("use zlib" ENABLE_ZLIB) +show_end_message_yesno("use libopenjpeg" LIBOPENJPEG_FOUND) +show_end_message_yesno("use cms" USE_CMS) +show_end_message_yesno("command line utils" ENABLE_UTILS) if(USE_FIXEDPOINT AND USE_FLOAT) message("Warning: Single precision and fixed point options should not be enabled at the same time") diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake index f8a0b64..aa54311 100644 --- a/cmake/modules/PopplerMacros.cmake +++ b/cmake/modules/PopplerMacros.cmake @@ -49,7 +49,7 @@ macro(POPPLER_CREATE_INSTALL_PKGCONFIG generated_file install_location) endif(NOT WIN32) endmacro(POPPLER_CREATE_INSTALL_PKGCONFIG) -macro(SHOW_END_MESSAGE what enabled) +macro(SHOW_END_MESSAGE_YESNO what enabled) string(LENGTH ${what} length_what) math(EXPR left_char "20 - ${length_what}") set(blanks) @@ -63,7 +63,7 @@ macro(SHOW_END_MESSAGE what enabled) endif(${enabled}) message(" ${what}:${blanks} ${enabled_string}") -endmacro(SHOW_END_MESSAGE) +endmacro(SHOW_END_MESSAGE_YESNO) set(CMAKE_SYSTEM_INCLUDE_PATH ${CMAKE_SYSTEM_INCLUDE_PATH} _______________________________________________ poppler mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/poppler
