-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
59 lines (48 loc) · 1.42 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
cmake_minimum_required(VERSION 3.5)
project(zipview VERSION 0.2 LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED)
find_package(QuaZip-Qt${QT_VERSION_MAJOR} REQUIRED)
set(PROJECT_SOURCES
main.cpp
# mainwindow.cpp mainwindow.h
delegate.h
delegate.cpp
view.h view.cpp
loader.h loader.cpp
window.h window.cpp
zipview.qrc
)
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
qt_add_executable(zipview
MANUAL_FINALIZATION
${PROJECT_SOURCES}
)
else()
add_executable(zipview
${PROJECT_SOURCES}
)
endif()
set(ICON_FILE "resources/zipview.svg")
set(DESKTOP_FILE "resources/zipview.desktop")
set(ICON_DIR /usr/share/icons/hicolor/scalable/apps)
set(DESKTOP_DIR /usr/share/applications)
install(FILES ${ICON_FILE} DESTINATION ${ICON_DIR})
install(FILES ${DESKTOP_FILE} DESTINATION ${DESKTOP_DIR})
install(TARGETS zipview RUNTIME DESTINATION "/usr/bin")
target_link_libraries(zipview PRIVATE
Threads::Threads
Qt${QT_VERSION_MAJOR}::Widgets
QuaZip::QuaZip
)
if(QT_VERSION_MAJOR EQUAL 6)
qt_finalize_executable(zipview)
endif()