summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
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 /CMakeLists.txt
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 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt44
1 files changed, 29 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 54b750968..3b5d5df2a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,21 +33,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()
@@ -57,11 +61,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)
@@ -106,6 +118,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")
@@ -227,7 +240,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
@@ -263,6 +276,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()