summaryrefslogtreecommitdiffstats
path: root/examples/pdfwidgets
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2021-07-09 19:24:15 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-08-18 05:28:15 +0000
commit649a3238f91921e3f38f8e91e49f97a02655c94d (patch)
tree99d24b2a7df5c31096e49a62c9d9a6781389d4c0 /examples/pdfwidgets
parent4245e8c147f3bc3512352b73462774c042426e81 (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 'examples/pdfwidgets')
-rw-r--r--examples/pdfwidgets/CMakeLists.txt1
-rw-r--r--examples/pdfwidgets/pdfviewer/CMakeLists.txt63
2 files changed, 64 insertions, 0 deletions
diff --git a/examples/pdfwidgets/CMakeLists.txt b/examples/pdfwidgets/CMakeLists.txt
new file mode 100644
index 000000000..37496ebe3
--- /dev/null
+++ b/examples/pdfwidgets/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory(pdfviewer)
diff --git a/examples/pdfwidgets/pdfviewer/CMakeLists.txt b/examples/pdfwidgets/pdfviewer/CMakeLists.txt
new file mode 100644
index 000000000..afcbf035a
--- /dev/null
+++ b/examples/pdfwidgets/pdfviewer/CMakeLists.txt
@@ -0,0 +1,63 @@
+# Generated from pdfviewer.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(pdfviewer LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/pdfwidgets/pdfviewer")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+qt_add_executable(pdfviewerwidgets
+ main.cpp
+ mainwindow.cpp mainwindow.h mainwindow.ui
+ pageselector.cpp pageselector.h
+ zoomselector.cpp zoomselector.h
+)
+set_target_properties(pdfviewerwidgets PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
+target_link_libraries(pdfviewerwidgets PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+ Qt::PdfWidgets
+)
+
+
+# Resources:
+set(resources_resource_files
+ "images/busy.png"
+ "images/fileopen.png"
+ "images/go-next-24.png"
+ "images/go-previous-24.png"
+ "images/zoom-in-24.png"
+ "images/zoom-in-32.png"
+ "images/zoom-out-24.png"
+ "images/zoom-out-32.png"
+)
+
+qt6_add_resources(pdfviewerwidgets "resources"
+ PREFIX
+ "/icons"
+ FILES
+ ${resources_resource_files}
+)
+
+install(TARGETS pdfviewerwidgets
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)