summaryrefslogtreecommitdiffstats
path: root/configure.cmake
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2021-07-09 19:24:15 +0200
committerMichal Klocek <michal.klocek@qt.io>2021-08-17 17:38:55 +0200
commit79d04aa9e3e9aa84d7378260519f9e9a6759dc41 (patch)
tree3f4b1ae9f514ffc2a3d730cb8d7db9fb72ee1e7d /configure.cmake
parent58b787cbad581914367aea4604993cce30a65d06 (diff)
Add QtPdf to cmake build
Port QtPdf to Qt6: * QtPdf,QtPdfWidgets,QtPdfQuick libs * QtPdfQuickPlugin, QtPdfPlugin (imageformat) plugins * widget and quick examples * qtpdf tests To fit gn cmake integration and new repo layout code is a bit reshuffled. Compared to qmke build following features are not ported yet: * ios fat libs * qtbase 3rdparty static dependencies WebEngine build can be skipped with setting QT_FEATURE_qtwebengine_build=OFF Note this patch needs follow up for 6.2 branch to disable qtpdf builds by default, since this should not part of qt 6.2 release. Pick-to: 6.2 Task-number: QTBUG-95353 Change-Id: I4dd9f3934bdd478fb6d2fa686074a24d91f09953 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'configure.cmake')
-rw-r--r--configure.cmake96
1 files changed, 52 insertions, 44 deletions
diff --git a/configure.cmake b/configure.cmake
index f0c83cce2..af4af125a 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -9,7 +9,7 @@ if(QT_CONFIGURE_RUNNING)
endfunction()
else()
find_package(Ninja 1.7.2)
- find_package(Gn ${QT_REPO_MODULE_VERSION} EXACT)
+ find_package(Gn ${QT_REPO_MODULES_VERSION} EXACT)
find_package(Python2 2.7.5)
find_package(GPerf)
find_package(BISON)
@@ -207,7 +207,17 @@ qt_feature("qtwebengine-quick-build" PRIVATE
)
qt_feature("qtpdf-build" PRIVATE
LABEL "Build Qt PDF"
- PURPOSE "Enables building the Qt PDF rendering module."
+ PURPOSE "Enables building the Qt Pdf modules."
+)
+qt_feature("qtpdf-widgets-build" PRIVATE
+ LABEL "Build Qt PdfWidgets"
+ PURPOSE "Enables building the Qt Pdf module."
+ CONDITION TARGET Qt::Widgets
+)
+qt_feature("qtpdf-quick-build" PRIVATE
+ LABEL "Build Qt PdfQuick"
+ PURPOSE "Enables building the Qt Pdf module."
+ CONDITION TARGET Qt::Quick AND TARGET Qt::Qml
)
qt_feature("webengine-system-ninja" PRIVATE
LABEL "Use system ninja"
@@ -326,77 +336,80 @@ else()
set(WIN_ARM_64 OFF)
endif()
-assertTargets(webEngineError webEngineSupport Gui Widgets OpenGL OpenGLWidgets Quick Qml)
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+assertTargets(
+ MODULES QtWebEngine QtPdf
+ TARGETS Gui Widgets OpenGL OpenGLWidgets Quick Qml
+)
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
CONDITION LINUX OR (WIN32 AND NOT WIN_ARM_64) OR (MACOS AND NOT CMAKE_CROSSCOMPILING)
MESSAGE "Build can be done only on Linux, Windows or macOS."
)
if(LINUX AND CMAKE_CROSSCOMPILING)
get_gn_arch(testArch ${TEST_architecture_arch})
- add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+ add_check_for_support(
+ MODULES QtWebEngine QtPdf
CONDITION testArch
MESSAGE "Cross compiling is not supported for ${TEST_architecture_arch}."
)
endif()
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
CONDITION NOT QT_FEATURE_static
MESSAGE "Static build is not supported."
)
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
CONDITION TARGET Nodejs::Nodejs
MESSAGE "node.js version 10.19 or later is required."
)
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
CONDITION Python2_FOUND
MESSAGE "Python2 version 2.7.5 or later is required."
)
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
CONDITION GPerf_FOUND
MESSAGE "Tool gperf is required."
)
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
CONDITION BISON_FOUND
MESSAGE "Tool bison is required."
)
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
CONDITION FLEX_FOUND
MESSAGE "Tool flex is required."
)
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
CONDITION NOT LINUX OR PkgConfig_FOUND
MESSAGE "A pkg-config support is required."
)
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
CONDITION NOT LINUX OR TEST_glibc
MESSAGE "A suitable version >= 2.17 of glibc is required."
)
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
CONDITION NOT LINUX OR TEST_khr
MESSAGE "Build requires Khronos development headers for build - see mesa/libegl1-mesa-dev"
)
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+add_check_for_support(
+ MODULES QtWebEngine
CONDITION NOT LINUX OR FONTCONFIG_FOUND
MESSAGE "Build requires fontconfig."
)
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+add_check_for_support(
+ MODULES QtWebEngine
CONDITION NOT LINUX OR NSS_FOUND
MESSAGE "Build requires nss >= 3.26."
)
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+add_check_for_support(
+ MODULES QtWebEngine
CONDITION NOT LINUX OR DBUS_FOUND
MESSAGE "Build requires dbus."
)
@@ -409,19 +422,19 @@ foreach(xs ${xcbSupport})
set(xcbErrorMessage "${xcbErrorMessage} ${xs}:NO")
endif()
endforeach()
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+add_check_for_support(
+ MODULES QtWebEngine
CONDITION NOT LINUX OR NOT QT_FEATURE_xcb OR QT_FEATURE_webengine_ozone_x11
MESSAGE "Could not find all necessary libraries for qpa-xcb support.\
${xcbErrorMessage}"
)
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
CONDITION NOT WIN32 OR TEST_winversion
MESSAGE "Build requires Visual Studio 2019 or higher."
)
-add_check_for_support(webEngineError webEngineSupport
- MODULE QtWebEngine
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
CONDITION
(LINUX AND CMAKE_CXX_COMPILER_ID STREQUAL GNU) OR
(LINUX AND CMAKE_CXX_COMPILER_ID STREQUAL Clang) OR
@@ -431,11 +444,6 @@ add_check_for_support(webEngineError webEngineSupport
(MACOS AND CMAKE_CXX_COMPILER_ID STREQUAL AppleClang)
MESSAGE "${CMAKE_CXX_COMPILER_ID} compiler is not supported."
)
-add_check_for_support(pdfError pdfSupport
- MODULE QtPdf
- CONDITION OFF
- MESSAGE "QtPdf is missing cmake port."
-)
#### Summary
@@ -475,13 +483,13 @@ qt_configure_end_summary_section()
qt_configure_add_report_entry(
TYPE NOTE
MESSAGE "QtWebEngine build is disabled by user."
- CONDITION ${webEngineSupport} AND NOT QT_FEATURE_qtwebengine_build
+ CONDITION QtWebEngine_SUPPORT AND NOT QT_FEATURE_qtwebengine_build
)
qt_configure_add_report_entry(
TYPE NOTE
MESSAGE "QtPdf build is disabled by user."
- CONDITION ${pdfSupport} AND NOT QT_FEATURE_qtpdf_build
+ CONDITION QtPdf_SUPPORT AND NOT QT_FEATURE_qtpdf_build
)
qt_configure_add_report_entry(