2023-03-23 15:25:43 +00:00
|
|
|
# Copyright (C) 2023 The Qt Company Ltd.
|
2024-03-12 14:56:50 +00:00
|
|
|
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2023-03-23 15:25:43 +00:00
|
|
|
|
|
|
|
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets PdfWidgets
|
|
|
|
OPTIONAL_COMPONENTS PrintSupport)
|
|
|
|
|
|
|
|
qt_add_plugin(pdfviewer
|
|
|
|
CLASS_NAME PdfViewer
|
|
|
|
pdfviewer.cpp pdfviewer.h
|
|
|
|
zoomselector.cpp zoomselector.h
|
|
|
|
hoverwatcher.cpp hoverwatcher.h
|
|
|
|
)
|
|
|
|
|
|
|
|
set_target_properties(pdfviewer PROPERTIES
|
|
|
|
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/app"
|
|
|
|
)
|
|
|
|
|
|
|
|
target_include_directories(pdfviewer PRIVATE
|
|
|
|
../../app
|
|
|
|
..
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(pdfviewer PRIVATE
|
|
|
|
Qt6::Core
|
|
|
|
Qt6::Gui
|
|
|
|
Qt6::Widgets
|
|
|
|
Qt6::PdfWidgets
|
2023-06-08 12:51:24 +00:00
|
|
|
abstractviewer
|
2023-03-23 15:25:43 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
if(TARGET Qt6::PrintSupport)
|
|
|
|
target_link_libraries(pdfviewer PRIVATE Qt6::PrintSupport)
|
|
|
|
endif()
|
|
|
|
|
2024-03-25 18:28:28 +00:00
|
|
|
if(WIN32)
|
|
|
|
set(install_destination "${CMAKE_INSTALL_BINDIR}/app")
|
|
|
|
elseif(APPLE)
|
|
|
|
set(install_destination ".")
|
|
|
|
else()
|
|
|
|
set(install_destination "${CMAKE_INSTALL_BINDIR}")
|
|
|
|
endif()
|
2023-03-23 15:25:43 +00:00
|
|
|
install(TARGETS pdfviewer
|
2024-03-25 18:28:28 +00:00
|
|
|
RUNTIME DESTINATION "${install_destination}"
|
|
|
|
LIBRARY DESTINATION "${install_destination}"
|
2023-03-23 15:25:43 +00:00
|
|
|
)
|