diff options
author | Michal Klocek <michal.klocek@qt.io> | 2021-07-09 19:24:15 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-08-18 05:28:15 +0000 |
commit | 649a3238f91921e3f38f8e91e49f97a02655c94d (patch) | |
tree | 99d24b2a7df5c31096e49a62c9d9a6781389d4c0 /CMakeLists.txt | |
parent | 4245e8c147f3bc3512352b73462774c042426e81 (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.
Task-number: QTBUG-95353
Change-Id: I4dd9f3934bdd478fb6d2fa686074a24d91f09953
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 79d04aa9e3e9aa84d7378260519f9e9a6759dc41)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9939167a0..823945088 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,21 +39,25 @@ set(__QtFeature_only_evaluate_features OFF) include(configure.cmake) include(src/core/api/configure.cmake) include(src/webenginequick/configure.cmake) +include(src/pdf/configure.cmake) qt_feature_module_end(ONLY_EVALUATE_FEATURES) - -if(NOT ${webEngineSupport}) +if(NOT ${QtWebEngine_SUPPORT}) add_custom_target(WebEngineErrorMessage ALL - ${CMAKE_COMMAND} -E cmake_echo_color --red "QtWebEngine will not be built: ${webEngineError}" - COMMENT "Check QtWebEngine support") - message("-- Support check for QtWebEngine failed: ${webEngineError}") + ${CMAKE_COMMAND} -E cmake_echo_color --red "QtWebEngine will not be built: ${QtWebEngine_ERROR}" + COMMENT "Check QtWebEngine support" + VERBATIM + ) + message("-- Support check for QtWebEngine failed: ${QtWebEngine_ERROR}") set(QT_FEATURE_qtwebengine_build OFF CACHE BOOL "Build QtWebEngine" FORCE) endif() -if(NOT ${pdfSupport}) +if(NOT ${QtPdf_SUPPORT}) add_custom_target(PdfErrorMessage ALL - ${CMAKE_COMMAND} -E cmake_echo_color --red "QtPdf will not be built: ${pdfError}" - COMMENT "Check QtPdf support") - message("-- Support check for QtPdf failed: ${pdfError}") + ${CMAKE_COMMAND} -E cmake_echo_color --red "QtPdf will not be built: ${QtPdf_ERROR}" + COMMENT "Check QtPdf support" + VERBATIM + ) + message("-- Support check for QtPdf failed: ${QtPdf_ERROR}") set(QT_FEATURE_qtpdf_build OFF CACHE BOOL "Build QtPdf" FORCE) endif() @@ -63,11 +67,19 @@ if(NOT QT_FEATURE_qtwebengine_build AND NOT QT_FEATURE_qtpdf_build) return() endif() -add_subdirectory(src/core/api) -add_subdirectory(src/core/tools) -add_subdirectory(src/process) -add_subdirectory(src/webenginewidgets) -add_subdirectory(src/webenginequick) +if(QT_FEATURE_qtwebengine_build) + add_subdirectory(src/core/api) + add_subdirectory(src/core/tools) + add_subdirectory(src/process) + add_subdirectory(src/webenginewidgets) + add_subdirectory(src/webenginequick) +endif() + +if(QT_FEATURE_qtpdf_build) + add_subdirectory(src/pdf) + add_subdirectory(src/pdfwidgets) + add_subdirectory(src/pdfquick) +endif() qt_build_repo_end() get_install_config(installConfig) @@ -112,6 +124,7 @@ endif() get_filename_component(WEBENGINE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" REALPATH) get_qt_features(featureList webengine) get_qt_features(featureList qtwebengine) +get_qt_features(featureList qtpdf) if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND QT_SUPERBUILD) set(CMAKE_TOOLCHAIN_FILE "${CMAKE_BINARY_DIR}/qtbase/lib/cmake/Qt6/qt.toolchain.cmake") @@ -233,7 +246,7 @@ if(NOT Ninja_FOUND) externalproject_add_stepdependencies(gn install ninja) endif() -if(NOT QT_FEATURE_framework) +if(QT_FEATURE_qtwebengine_build AND NOT QT_FEATURE_framework) # install resources (again), coin calls install with DESTDIR install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/translations/qtwebengine_locales DESTINATION ${CMAKE_INSTALL_PREFIX}/translations @@ -269,6 +282,7 @@ if(CMAKE_CROSSCOMPILING) -DCMAKE_C_FLAGS= -DCMAKE_CXX_FLAGS= -DQT_FEATURE_qtwebengine_build=${QT_FEATURE_qtwebengine_build} + -DQT_FEATURE_qtpdf_build=${QT_FEATURE_qtpdf_build} ) externalproject_add_stepdependencies(qtwebengine install hostBuild) endif() |