Make building PDF4Qt optional, and opt-in

There's some added dependancies required for building this, so
let's play it safe for now...
This commit is contained in:
Nyall Dawson 2023-12-20 12:30:24 +10:00
parent 000d3ede96
commit b43f73a1f1
3 changed files with 15 additions and 3 deletions

View File

@ -492,6 +492,14 @@ if(WITH_CORE)
set (HAVE_QTGAMEPAD TRUE)
endif()
set (WITH_PDF4QT FALSE CACHE BOOL "Determines whether the embedded PDF4Qt library should be build for PDF and HTML to QPainter conversion")
if (WITH_PDF4QT)
set(HAVE_PDF4QT TRUE) # used in qgisconfig.h
message(STATUS "PDF4Qt enabled")
else()
message(STATUS "PDF4Qt disabled")
endif()
find_package(${QT_VERSION_BASE} COMPONENTS Core Gui Widgets Network Xml Svg Concurrent Test Sql Positioning REQUIRED)
if (BUILD_WITH_QT6)
find_package(${QT_VERSION_BASE} COMPONENTS Core5Compat REQUIRED)

View File

@ -122,6 +122,8 @@
#cmakedefine HAS_KDE_QT5_SMALL_CAPS_FIX
#cmakedefine HAS_KDE_QT5_FONT_STRETCH_FIX
#cmakedefine HAVE_PDF4QT
#cmakedefine HAVE_CRASH_HANDLER
#cmakedefine HAVE_WEBENGINE

View File

@ -11,9 +11,11 @@ BISON_TARGET(QgsMeshCalcParser mesh/qgsmeshcalcparser.yy ${CMAKE_CURRENT_BINARY_
FLEX_TARGET(QgsMeshCalcLexer mesh/qgsmeshcalclexer.ll ${CMAKE_CURRENT_BINARY_DIR}/qgsmeshcalclexer.cpp)
ADD_FLEX_BISON_DEPENDENCY(QgsMeshCalcLexer QgsMeshCalcParser)
SET(PDF4QT_BUILD_ONLY_CORE_LIBRARY TRUE)
SET(PDF4QT_ENABLE_OPENGL FALSE)
SUBDIRS(${CMAKE_SOURCE_DIR}/external/PDF4QT)
if (WITH_PDF4QT)
SET(PDF4QT_BUILD_ONLY_CORE_LIBRARY TRUE)
SET(PDF4QT_ENABLE_OPENGL FALSE)
SUBDIRS(${CMAKE_SOURCE_DIR}/external/PDF4QT)
endif()
set(QGIS_CORE_SRCS
${CMAKE_SOURCE_DIR}/external/kdbush/include/kdbush.hpp