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
|
|
|
|
|
|
|
qt_add_plugin(jsonviewer
|
|
|
|
CLASS_NAME JsonViewer
|
|
|
|
jsonviewer.cpp jsonviewer.h
|
|
|
|
)
|
|
|
|
|
|
|
|
set_target_properties(jsonviewer PROPERTIES
|
documentviewer: Fix deployment for macOS, Windows, Linux
Adapt the logic to install and detect especially the
plugins libs:
* Do not just compile them into the app build folder, but
keep the libs separate under the 'plugins' direcory
* At installation time, follow the logic of *deployqt
for Qt plugins, and store them in CMAKE_INSTALL_PREFIX/plugins
(Linux, Windows) or Document Viewer.app/Contents/Plugins
(macOS).
Unfortunately, this all requires different look ups at runtime for
all operating systems. For macOS and Windows, we furthermore need
to check both for valid paths with an installed build, and an
un-installed build.
While at it, move the install logic to app/CMakeLists.txt, so that
there is less repetition.
An alternative approach would be to calculate the relative paths
at configure time, and either pass on command line or in a created
header file. Anyhow, the current approach is more compact.
Pick-to: 6.10
Fixes: QTBUG-138476
Change-Id: I467d3bd4e14ef6b8b747bceb7177837e2edd3b8c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-07-10 15:04:37 +00:00
|
|
|
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
|
2023-03-23 15:25:43 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(jsonviewer PRIVATE
|
|
|
|
Qt6::Core
|
|
|
|
Qt6::Gui
|
|
|
|
Qt6::Widgets
|
2023-06-08 12:51:24 +00:00
|
|
|
abstractviewer
|
2023-03-23 15:25:43 +00:00
|
|
|
)
|
|
|
|
|
2025-04-17 12:46:19 +00:00
|
|
|
qt_add_translations(jsonviewer
|
|
|
|
SOURCE_TARGETS jsonviewer
|
2025-05-02 07:13:49 +00:00
|
|
|
TS_FILE_BASE jsonviewer
|
2025-04-17 12:46:19 +00:00
|
|
|
)
|
|
|
|
|
2023-03-23 15:25:43 +00:00
|
|
|
if(TARGET Qt6::PrintSupport)
|
|
|
|
target_link_libraries(jsonviewer PRIVATE Qt6::PrintSupport)
|
|
|
|
endif()
|
|
|
|
|