From 1a10401b91f92fdfe0ae8e3c91803979f8517f95 Mon Sep 17 00:00:00 2001 From: Jakub Melka Date: Sat, 2 Dec 2023 18:35:11 +0100 Subject: [PATCH] Issue #118: Adding CMAKE options for minimal builds --- CMakeLists.txt | 12 +++++- Pdf4QtDocDiff/CMakeLists.txt | 6 ++- Pdf4QtLib/CMakeLists.txt | 6 ++- Pdf4QtLib/sources/pdfdrawwidget.cpp | 16 +++++++ Pdf4QtLib/sources/pdfdrawwidget.h | 43 +++++++++++-------- Pdf4QtLib/sources/pdfrenderer.cpp | 27 ++++++++++++ Pdf4QtLib/sources/pdfrenderer.h | 4 ++ Pdf4QtViewer/CMakeLists.txt | 6 ++- Pdf4QtViewer/pdfprogramcontroller.cpp | 8 ++++ .../AudioBookPlugin/CMakeLists.txt | 6 ++- .../DimensionsPlugin/CMakeLists.txt | 6 ++- .../ObjectInspectorPlugin/CMakeLists.txt | 6 ++- .../OutputPreviewPlugin/CMakeLists.txt | 6 ++- .../RedactPlugin/CMakeLists.txt | 6 ++- .../SignaturePlugin/CMakeLists.txt | 6 ++- .../SoftProofingPlugin/CMakeLists.txt | 6 ++- 16 files changed, 141 insertions(+), 29 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2866709..fa0f87a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,8 @@ if(WIN32 AND MSVC) option(PDF4QT_INSTALL_PREPARE_WIX_INSTALLER "Prepare Wix installer for Windows" ON) endif() +option(PDF4QT_ENABLE_OPENGL "Enable OpenGL" ON) + set(PDF4QT_QT_ROOT "" CACHE PATH "Qt root directory") if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) @@ -43,7 +45,13 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) include(GNUInstallDirs) -find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets Svg Xml PrintSupport TextToSpeech OpenGL OpenGLWidgets Multimedia Network Test) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets Svg Xml PrintSupport TextToSpeech Multimedia Network Test) + +if(PDF4QT_ENABLE_OPENGL) + add_compile_definitions(PDF4QT_ENABLE_OPENGL) + find_package(Qt6 REQUIRED COMPONENTS OpenGL OpenGLWidgets) +endif() + qt_standard_project_setup() find_package(OpenSSL REQUIRED) @@ -80,7 +88,7 @@ if (LINUX_GCC) find_package(TBB REQUIRED) endif() -option(PDF4QT_INSTALL_TO_USR "Install to usr directory" OFF) +option(PDF4QT_INSTALL_TO_USR "Install to usr directory" ON) if(PDF4QT_LINUX) set(PDF4QT_INSTALL_LIB_DIR_IMPL lib) diff --git a/Pdf4QtDocDiff/CMakeLists.txt b/Pdf4QtDocDiff/CMakeLists.txt index 96a306b..1659bf4 100644 --- a/Pdf4QtDocDiff/CMakeLists.txt +++ b/Pdf4QtDocDiff/CMakeLists.txt @@ -30,7 +30,11 @@ add_executable(Pdf4QtDocDiff icon.rc ) -target_link_libraries(Pdf4QtDocDiff PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets Qt6::OpenGLWidgets) +if(PDF4QT_ENABLE_OPENGL) + target_link_libraries(Pdf4QtDocDiff PRIVATE Pdf4QtLib Qt6::OpenGLWidgets) +endif() + +target_link_libraries(Pdf4QtDocDiff PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets) set_target_properties(Pdf4QtDocDiff PROPERTIES WIN32_EXECUTABLE ON diff --git a/Pdf4QtLib/CMakeLists.txt b/Pdf4QtLib/CMakeLists.txt index 310d131..01b6f0b 100644 --- a/Pdf4QtLib/CMakeLists.txt +++ b/Pdf4QtLib/CMakeLists.txt @@ -114,7 +114,11 @@ GENERATE_EXPORT_HEADER(Pdf4QtLib PDF4QTLIBSHARED_EXPORT EXPORT_FILE_NAME "${CMAKE_BINARY_DIR}/${INSTALL_INCLUDEDIR}/pdf4qtlib_export.h") -target_link_libraries(Pdf4QtLib PRIVATE Qt6::Core Qt6::Gui Qt6::Widgets Qt6::Xml Qt6::Svg Qt6::OpenGLWidgets) +if(PDF4QT_ENABLE_OPENGL) + target_link_libraries(Pdf4QtLib PRIVATE Qt6::OpenGLWidgets) +endif() + +target_link_libraries(Pdf4QtLib PRIVATE Qt6::Core Qt6::Gui Qt6::Widgets Qt6::Xml Qt6::Svg) target_link_libraries(Pdf4QtLib PRIVATE lcms2::lcms2) target_link_libraries(Pdf4QtLib PRIVATE OpenSSL::SSL OpenSSL::Crypto) target_link_libraries(Pdf4QtLib PRIVATE ZLIB::ZLIB) diff --git a/Pdf4QtLib/sources/pdfdrawwidget.cpp b/Pdf4QtLib/sources/pdfdrawwidget.cpp index 0249938..874d64c 100644 --- a/Pdf4QtLib/sources/pdfdrawwidget.cpp +++ b/Pdf4QtLib/sources/pdfdrawwidget.cpp @@ -107,6 +107,7 @@ void PDFWidget::updateRenderer(RendererEngine engine, int samplesCount) setFocusProxy(m_drawWidget->getWidget()); connect(m_proxy, &PDFDrawWidgetProxy::repaintNeeded, m_drawWidget->getWidget(), QOverload<>::of(&QWidget::update)); } +#ifdef PDF4QT_ENABLE_OPENGL else if (openglDrawWidget) { // Just check the samples count @@ -117,6 +118,8 @@ void PDFWidget::updateRenderer(RendererEngine engine, int samplesCount) openglDrawWidget->setFormat(format); } } +#endif + updateRendererImpl(); } @@ -139,8 +142,12 @@ int PDFWidget::getPageRenderingErrorCount() const void PDFWidget::updateRendererImpl() { +#ifdef PDF4QT_ENABLE_OPENGL PDFOpenGLDrawWidget* openglDrawWidget = qobject_cast(m_drawWidget->getWidget()); m_proxy->updateRenderer(openglDrawWidget != nullptr, openglDrawWidget ? openglDrawWidget->format() : QSurfaceFormat::defaultFormat()); +#else + m_proxy->updateRenderer(false, QSurfaceFormat::defaultFormat()); +#endif } void PDFWidget::onRenderingError(PDFInteger pageIndex, const QList& errors) @@ -181,7 +188,12 @@ IDrawWidget* PDFWidget::createDrawWidget(RendererEngine rendererEngine, int samp return new PDFDrawWidget(this, this); case RendererEngine::OpenGL: +#ifdef PDF4QT_ENABLE_OPENGL return new PDFOpenGLDrawWidget(this, samplesCount, this); +#else + Q_UNUSED(samplesCount); + return new PDFDrawWidget(this, this); +#endif default: Q_ASSERT(false); @@ -573,6 +585,7 @@ void PDFDrawWidgetBase::wheelEvent(QWheelEvent* event) event->accept(); } +#ifdef PDF4QT_ENABLE_OPENGL PDFOpenGLDrawWidget::PDFOpenGLDrawWidget(PDFWidget* widget, int samplesCount, QWidget* parent) : BaseClass(widget, parent) { @@ -609,6 +622,7 @@ void PDFOpenGLDrawWidget::paintGL() getPDFWidget()->getDrawWidgetProxy()->draw(&painter, this->rect()); } } +#endif PDFDrawWidget::PDFDrawWidget(PDFWidget* widget, QWidget* parent) : BaseClass(widget, parent) @@ -636,7 +650,9 @@ void PDFDrawWidget::resizeEvent(QResizeEvent* event) getPDFWidget()->getDrawWidgetProxy()->update(); } +#ifdef PDF4QT_ENABLE_OPENGL template class PDFDrawWidgetBase; +#endif template class PDFDrawWidgetBase; } // namespace pdf diff --git a/Pdf4QtLib/sources/pdfdrawwidget.h b/Pdf4QtLib/sources/pdfdrawwidget.h index 3b0ec78..b567a47 100644 --- a/Pdf4QtLib/sources/pdfdrawwidget.h +++ b/Pdf4QtLib/sources/pdfdrawwidget.h @@ -23,7 +23,10 @@ #include #include + +#ifdef PDF4QT_ENABLE_OPENGL #include +#endif namespace pdf { @@ -176,23 +179,6 @@ private: MouseOperation m_mouseOperation; }; -class PDFOpenGLDrawWidget : public PDFDrawWidgetBase -{ - Q_OBJECT - -private: - using BaseClass = PDFDrawWidgetBase; - -public: - explicit PDFOpenGLDrawWidget(PDFWidget* widget, int samplesCount, QWidget* parent); - virtual ~PDFOpenGLDrawWidget() override; - -protected: - virtual void resizeGL(int w, int h) override; - virtual void initializeGL() override; - virtual void paintGL() override; -}; - class PDFDrawWidget : public PDFDrawWidgetBase { Q_OBJECT @@ -209,7 +195,30 @@ protected: virtual void resizeEvent(QResizeEvent* event) override; }; +#ifdef PDF4QT_ENABLE_OPENGL +class PDFOpenGLDrawWidget : public PDFDrawWidgetBase +{ + Q_OBJECT + +private: + using BaseClass = PDFDrawWidgetBase; + +public: + explicit PDFOpenGLDrawWidget(PDFWidget* widget, int samplesCount, QWidget* parent); + virtual ~PDFOpenGLDrawWidget() override; + +protected: + virtual void resizeGL(int w, int h) override; + virtual void initializeGL() override; + virtual void paintGL() override; +}; +#else +using PDFOpenGLDrawWidget = PDFDrawWidget; +#endif + +#ifdef PDF4QT_ENABLE_OPENGL extern template class PDFDrawWidgetBase; +#endif extern template class PDFDrawWidgetBase; } // namespace pdf diff --git a/Pdf4QtLib/sources/pdfrenderer.cpp b/Pdf4QtLib/sources/pdfrenderer.cpp index 4f25219..321c096 100644 --- a/Pdf4QtLib/sources/pdfrenderer.cpp +++ b/Pdf4QtLib/sources/pdfrenderer.cpp @@ -25,11 +25,14 @@ #include #include + +#ifdef PDF4QT_ENABLE_OPENGL #include #include #include #include #include +#endif namespace pdf { @@ -222,18 +225,24 @@ void PDFRenderer::compile(PDFPrecompiledPage* precompiledPage, size_t pageIndex) PDFRasterizer::PDFRasterizer(QObject* parent) : BaseClass(parent), +#ifdef PDF4QT_ENABLE_OPENGL m_features(), m_surfaceFormat(), m_surface(nullptr), m_context(nullptr), m_fbo(nullptr) +#else + m_features() +#endif { } PDFRasterizer::~PDFRasterizer() { +#ifdef PDF4QT_ENABLE_OPENGL releaseOpenGL(); +#endif } void PDFRasterizer::reset(bool useOpenGL, const QSurfaceFormat& surfaceFormat) @@ -244,6 +253,7 @@ void PDFRasterizer::reset(bool useOpenGL, const QSurfaceFormat& surfaceFormat) m_features.setFlag(ValidOpenGL, false); } +#ifdef PDF4QT_ENABLE_OPENGL if (useOpenGL != m_features.testFlag(UseOpenGL) || surfaceFormat != m_surfaceFormat) { // In either case, we must reset OpenGL @@ -259,6 +269,10 @@ void PDFRasterizer::reset(bool useOpenGL, const QSurfaceFormat& surfaceFormat) initializeOpenGL(); } } +#else + Q_UNUSED(surfaceFormat); + m_features.setFlag(UseOpenGL, useOpenGL); +#endif } QImage PDFRasterizer::render(PDFInteger pageIndex, @@ -272,6 +286,8 @@ QImage PDFRasterizer::render(PDFInteger pageIndex, QImage image; QTransform matrix = PDFRenderer::createPagePointToDevicePointMatrix(page, QRect(QPoint(0, 0), size), extraRotation); + +#ifdef PDF4QT_ENABLE_OPENGL if (m_features.testFlag(UseOpenGL) && m_features.testFlag(ValidOpenGL)) { // We have valid OpenGL context, try to select it and possibly create framebuffer object @@ -324,6 +340,7 @@ QImage PDFRasterizer::render(PDFInteger pageIndex, m_context->doneCurrent(); } } +#endif if (image.isNull()) { @@ -361,6 +378,7 @@ QImage PDFRasterizer::render(PDFInteger pageIndex, return image; } +#ifdef PDF4QT_ENABLE_OPENGL void PDFRasterizer::initializeOpenGL() { Q_ASSERT(!m_surface); @@ -408,7 +426,9 @@ void PDFRasterizer::initializeOpenGL() releaseOpenGL(); } } +#endif +#ifdef PDF4QT_ENABLE_OPENGL void PDFRasterizer::releaseOpenGL() { if (m_surface) @@ -437,6 +457,7 @@ void PDFRasterizer::releaseOpenGL() m_features.setFlag(ValidOpenGL, false); } } +#endif PDFRasterizer* PDFRasterizerPool::acquire() { @@ -983,6 +1004,7 @@ const PDFRendererInfo::Info& PDFRendererInfo::getHardwareAccelerationSupportedIn { Info info; +#ifdef PDF4QT_ENABLE_OPENGL QOffscreenSurface surface; surface.create(); @@ -1044,6 +1066,7 @@ const PDFRendererInfo::Info& PDFRendererInfo::getHardwareAccelerationSupportedIn info.majorOpenGLVersion = versionStrSplitted[0].toInt(); info.minorOpenGLVersion = versionStrSplitted[1].toInt(); } +#endif return info; }; @@ -1053,8 +1076,12 @@ const PDFRendererInfo::Info& PDFRendererInfo::getHardwareAccelerationSupportedIn bool PDFRendererInfo::isHardwareAccelerationSupported() { +#ifdef PDF4QT_ENABLE_OPENGL const Info& info = getHardwareAccelerationSupportedInfo(); return std::make_pair(info.majorOpenGLVersion, info.minorOpenGLVersion) >= std::make_pair(REQUIRED_OPENGL_MAJOR_VERSION, REQUIRED_OPENGL_MINOR_VERSION); +#else + return false; +#endif } } // namespace pdf diff --git a/Pdf4QtLib/sources/pdfrenderer.h b/Pdf4QtLib/sources/pdfrenderer.h index 5045101..7c2c5ad 100644 --- a/Pdf4QtLib/sources/pdfrenderer.h +++ b/Pdf4QtLib/sources/pdfrenderer.h @@ -217,14 +217,18 @@ public: PageRotation extraRotation); private: +#ifdef PDF4QT_ENABLE_OPENGL void initializeOpenGL(); void releaseOpenGL(); +#endif Features m_features; +#ifdef PDF4QT_ENABLE_OPENGL QSurfaceFormat m_surfaceFormat; QOffscreenSurface* m_surface; QOpenGLContext* m_context; QOpenGLFramebufferObject* m_fbo; +#endif }; /// Simple structure for storing rendered page images diff --git a/Pdf4QtViewer/CMakeLists.txt b/Pdf4QtViewer/CMakeLists.txt index 6ef4518..4725971 100644 --- a/Pdf4QtViewer/CMakeLists.txt +++ b/Pdf4QtViewer/CMakeLists.txt @@ -62,7 +62,11 @@ GENERATE_EXPORT_HEADER(Pdf4QtViewer PDF4QTVIEWERLIBSHARED_EXPORT EXPORT_FILE_NAME "${CMAKE_BINARY_DIR}/${INSTALL_INCLUDEDIR}/pdf4qtviewer_export.h") -target_link_libraries(Pdf4QtViewer PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets Qt6::PrintSupport Qt6::TextToSpeech Qt6::Xml Qt6::Svg Qt6::OpenGLWidgets) +if(PDF4QT_ENABLE_OPENGL) + target_link_libraries(Pdf4QtViewer PRIVATE Qt6::OpenGLWidgets) +endif() + +target_link_libraries(Pdf4QtViewer PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets Qt6::PrintSupport Qt6::TextToSpeech Qt6::Xml Qt6::Svg) target_include_directories(Pdf4QtViewer INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories(Pdf4QtViewer PUBLIC ${CMAKE_BINARY_DIR}/${INSTALL_INCLUDEDIR}) diff --git a/Pdf4QtViewer/pdfprogramcontroller.cpp b/Pdf4QtViewer/pdfprogramcontroller.cpp index 43ea173..89785bf 100644 --- a/Pdf4QtViewer/pdfprogramcontroller.cpp +++ b/Pdf4QtViewer/pdfprogramcontroller.cpp @@ -56,6 +56,10 @@ #include #include +#ifdef Q_OS_WIN +#include +#endif + #if defined(PDF4QT_USE_PRAGMA_LIB) #pragma comment(lib, "Shell32") #endif @@ -2184,12 +2188,16 @@ void PDFProgramController::checkHardwareOpenGLAvailability() if (m_settings->getRendererEngine() == pdf::RendererEngine::OpenGL && !pdf::PDFRendererInfo::isHardwareAccelerationSupported()) { +#ifdef PDF4QT_ENABLE_OPENGL pdf::PDFRendererInfo::Info info = pdf::PDFRendererInfo::getHardwareAccelerationSupportedInfo(); QMessageBox::warning(m_mainWindow, tr("Warning"), tr("Hardware acceleration is not supported on this device. " "OpenGL version at least 3.2 is required. Software rendering is used instead. " "Available OpenGL is %1 using %2. You can turn off hardware acceleration " "in 'Tools' menu using 'Options' item to stop displaying this message.").arg(info.version, info.renderer)); +#else + QMessageBox::warning(m_mainWindow, tr("Warning"), tr("Hardware acceleration is not enabled in this build.")); +#endif } } diff --git a/Pdf4QtViewerPlugins/AudioBookPlugin/CMakeLists.txt b/Pdf4QtViewerPlugins/AudioBookPlugin/CMakeLists.txt index 7fe95a8..1855cf9 100644 --- a/Pdf4QtViewerPlugins/AudioBookPlugin/CMakeLists.txt +++ b/Pdf4QtViewerPlugins/AudioBookPlugin/CMakeLists.txt @@ -23,7 +23,11 @@ add_library(AudioBookPlugin SHARED icons.qrc ) -target_link_libraries(AudioBookPlugin PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets Qt6::OpenGLWidgets) +if(PDF4QT_ENABLE_OPENGL) + target_link_libraries(AudioBookPlugin PRIVATE Qt6::OpenGLWidgets) +endif() + +target_link_libraries(AudioBookPlugin PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets) if(MINGW) target_link_libraries(AudioBookPlugin PRIVATE ole32 sapi) diff --git a/Pdf4QtViewerPlugins/DimensionsPlugin/CMakeLists.txt b/Pdf4QtViewerPlugins/DimensionsPlugin/CMakeLists.txt index 1a51c1c..f2c73df 100644 --- a/Pdf4QtViewerPlugins/DimensionsPlugin/CMakeLists.txt +++ b/Pdf4QtViewerPlugins/DimensionsPlugin/CMakeLists.txt @@ -23,7 +23,11 @@ add_library(DimensionsPlugin SHARED icons.qrc ) -target_link_libraries(DimensionsPlugin PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets Qt6::OpenGLWidgets) +if(PDF4QT_ENABLE_OPENGL) + target_link_libraries(DimensionsPlugin PRIVATE Qt6::OpenGLWidgets) +endif() + +target_link_libraries(DimensionsPlugin PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets) set_target_properties(DimensionsPlugin PROPERTIES VERSION ${PDF4QT_VERSION} diff --git a/Pdf4QtViewerPlugins/ObjectInspectorPlugin/CMakeLists.txt b/Pdf4QtViewerPlugins/ObjectInspectorPlugin/CMakeLists.txt index 0eb4fcb..e65eee8 100644 --- a/Pdf4QtViewerPlugins/ObjectInspectorPlugin/CMakeLists.txt +++ b/Pdf4QtViewerPlugins/ObjectInspectorPlugin/CMakeLists.txt @@ -29,7 +29,11 @@ add_library(ObjectInspectorPlugin SHARED icons.qrc ) -target_link_libraries(ObjectInspectorPlugin PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets Qt6::OpenGLWidgets) +if(PDF4QT_ENABLE_OPENGL) + target_link_libraries(ObjectInspectorPlugin PRIVATE Qt6::OpenGLWidgets) +endif() + +target_link_libraries(ObjectInspectorPlugin PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets) set_target_properties(ObjectInspectorPlugin PROPERTIES VERSION ${PDF4QT_VERSION} diff --git a/Pdf4QtViewerPlugins/OutputPreviewPlugin/CMakeLists.txt b/Pdf4QtViewerPlugins/OutputPreviewPlugin/CMakeLists.txt index 7b03572..40caa5c 100644 --- a/Pdf4QtViewerPlugins/OutputPreviewPlugin/CMakeLists.txt +++ b/Pdf4QtViewerPlugins/OutputPreviewPlugin/CMakeLists.txt @@ -25,7 +25,11 @@ add_library(OutputPreviewPlugin SHARED icons.qrc ) -target_link_libraries(OutputPreviewPlugin PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets Qt6::OpenGLWidgets) +if(PDF4QT_ENABLE_OPENGL) + target_link_libraries(OutputPreviewPlugin PRIVATE Qt6::OpenGLWidgets) +endif() + +target_link_libraries(OutputPreviewPlugin PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets) set_target_properties(OutputPreviewPlugin PROPERTIES VERSION ${PDF4QT_VERSION} diff --git a/Pdf4QtViewerPlugins/RedactPlugin/CMakeLists.txt b/Pdf4QtViewerPlugins/RedactPlugin/CMakeLists.txt index 0f41f7d..b3d94c6 100644 --- a/Pdf4QtViewerPlugins/RedactPlugin/CMakeLists.txt +++ b/Pdf4QtViewerPlugins/RedactPlugin/CMakeLists.txt @@ -22,7 +22,11 @@ add_library(RedactPlugin SHARED icons.qrc ) -target_link_libraries(RedactPlugin PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets Qt6::OpenGLWidgets) +if(PDF4QT_ENABLE_OPENGL) + target_link_libraries(RedactPlugin PRIVATE Qt6::OpenGLWidgets) +endif() + +target_link_libraries(RedactPlugin PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets) set_target_properties(RedactPlugin PROPERTIES VERSION ${PDF4QT_VERSION} diff --git a/Pdf4QtViewerPlugins/SignaturePlugin/CMakeLists.txt b/Pdf4QtViewerPlugins/SignaturePlugin/CMakeLists.txt index d6b5f7e..6b8e826 100644 --- a/Pdf4QtViewerPlugins/SignaturePlugin/CMakeLists.txt +++ b/Pdf4QtViewerPlugins/SignaturePlugin/CMakeLists.txt @@ -22,7 +22,11 @@ add_library(SignaturePlugin SHARED icons.qrc ) -target_link_libraries(SignaturePlugin PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets Qt6::OpenGLWidgets) +if(PDF4QT_ENABLE_OPENGL) + target_link_libraries(SignaturePlugin PRIVATE Qt6::OpenGLWidgets) +endif() + +target_link_libraries(SignaturePlugin PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets) target_link_libraries(SignaturePlugin PRIVATE OpenSSL::SSL OpenSSL::Crypto) set_target_properties(SignaturePlugin PROPERTIES diff --git a/Pdf4QtViewerPlugins/SoftProofingPlugin/CMakeLists.txt b/Pdf4QtViewerPlugins/SoftProofingPlugin/CMakeLists.txt index 8437123..6591227 100644 --- a/Pdf4QtViewerPlugins/SoftProofingPlugin/CMakeLists.txt +++ b/Pdf4QtViewerPlugins/SoftProofingPlugin/CMakeLists.txt @@ -22,7 +22,11 @@ add_library(SoftProofingPlugin SHARED icons.qrc ) -target_link_libraries(SoftProofingPlugin PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets Qt6::OpenGLWidgets) +if(PDF4QT_ENABLE_OPENGL) + target_link_libraries(SoftProofingPlugin PRIVATE Qt6::OpenGLWidgets) +endif() + +target_link_libraries(SoftProofingPlugin PRIVATE Pdf4QtLib Qt6::Core Qt6::Gui Qt6::Widgets) set_target_properties(SoftProofingPlugin PROPERTIES VERSION ${PDF4QT_VERSION}