Skip to content

Commit 4aced3f

Browse files
committed
fix cpack and qt6 compatibility
1 parent 7455d73 commit 4aced3f

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

CMakeLists.txt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ set(CMAKE_AUTORCC ON)
1313
set(CMAKE_CXX_STANDARD 11)
1414
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1515

16-
set(Qt5_in_use true)
17-
find_package(Qt5 COMPONENTS Widgets QUIET)
16+
set(QtVer Qt5)
17+
find_package(${QtVer} COMPONENTS Widgets QUIET)
1818
if (NOT Qt5_FOUND)
19-
set(Qt5_in_use false)
20-
find_package(Qt6 COMPONENTS Widgets REQUIRED)
19+
set(QtVer Qt6)
20+
find_package(${QtVer} COMPONENTS Widgets REQUIRED)
2121
endif ()
2222

2323
if (APPLE)
@@ -39,11 +39,9 @@ set(SOURCES
3939
finfdialog.ui
4040
)
4141
target_sources(Qldd PRIVATE ${SOURCES})
42-
if (Qt5_in_use)
43-
target_link_libraries(Qldd PRIVATE Qt5::Widgets)
44-
else ()
45-
target_link_libraries(Qldd PRIVATE Qt6::Widgets)
46-
endif ()
42+
43+
target_link_libraries(Qldd PRIVATE ${QtVer}::Widgets)
44+
4745
install(TARGETS Qldd
4846
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
4947
BUNDLE DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
@@ -72,14 +70,16 @@ if(APPLE)
7270
MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_VERSION}"
7371
MACOSX_BUNDLE_COPYRIGHT "Copyright (c) 2020 bas524@yandex.ru"
7472
)
75-
add_custom_command(TARGET Qldd
73+
if (${QtVer} STREQUAL Qt5)
74+
add_custom_command(TARGET Qldd
7675
POST_BUILD
7776
COMMAND plutil -replace NSHighResolutionCapable -bool true Qldd.app/Contents/Info.plist
7877
)
78+
endif()
7979
endif()
8080

8181
set(desktop.path applications)
82-
set(desktop.files resources/example.desktop)
82+
set(desktop.files resources/qldd.desktop)
8383
set(icon.path icons/hicolor/64x64/apps)
8484
set(icon.files resources/icon64.png)
8585
set(iconsvg.path icons/hicolor/scalable/apps)

Packaging.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

2-
find_package(Qt5Core REQUIRED)
3-
get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
2+
find_package(${QtVer}Core REQUIRED)
3+
get_target_property(_qmake_executable ${QtVer}::qmake IMPORTED_LOCATION)
44
get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
55
find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${_qt_bin_dir}")
66
find_program(LINUXDEPLOYQT_EXECUTABLE linuxdeployqt linuxdeployqt-continuous-x86_64.AppImage HINTS "${_qt_bin_dir}")

qldd.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ void QLdd::fillDependency(QTreeWidget &treeWidget) {
137137
for (const QString &v : qAsConst(sl)) {
138138
if (!v.trimmed().isEmpty()) {
139139
if (v.contains("not found")) {
140-
tmp->setTextColor(0, redC);
140+
tmp->setForeground(0, QBrush(redC));
141141
tmp->setText(0, tmp->text(0) + " " + v);
142142
tmp->setToolTip(0, tmp->text(0));
143143
} else {

0 commit comments

Comments
 (0)