@@ -13,11 +13,11 @@ set(CMAKE_AUTORCC ON)
13
13
set (CMAKE_CXX_STANDARD 11 )
14
14
set (CMAKE_CXX_STANDARD_REQUIRED ON )
15
15
16
- set (Qt5_in_use true )
17
- find_package (Qt5 COMPONENTS Widgets QUIET )
16
+ set (QtVer Qt5 )
17
+ find_package (${QtVer} COMPONENTS Widgets QUIET )
18
18
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 )
21
21
endif ()
22
22
23
23
if (APPLE )
@@ -39,11 +39,9 @@ set(SOURCES
39
39
finfdialog.ui
40
40
)
41
41
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
+
47
45
install (TARGETS Qldd
48
46
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX} /bin
49
47
BUNDLE DESTINATION ${CMAKE_INSTALL_PREFIX} /bin
@@ -72,14 +70,16 @@ if(APPLE)
72
70
MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_VERSION} "
73
71
MACOSX_BUNDLE_COPYRIGHT "Copyright (c) 2020 bas524@yandex.ru"
74
72
)
75
- add_custom_command (TARGET Qldd
73
+ if (${QtVer} STREQUAL Qt5 )
74
+ add_custom_command (TARGET Qldd
76
75
POST_BUILD
77
76
COMMAND plutil -replace NSHighResolutionCapable -bool true Qldd.app/Contents/Info.plist
78
77
)
78
+ endif ()
79
79
endif ()
80
80
81
81
set (desktop.path applications )
82
- set (desktop.files resources/example .desktop )
82
+ set (desktop.files resources/qldd .desktop )
83
83
set (icon.path icons/hicolor/64x64/apps )
84
84
set (icon.files resources/icon64.png )
85
85
set (iconsvg.path icons/hicolor/scalable/apps )
0 commit comments