-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
117 lines (98 loc) · 2.15 KB
/
CMakeLists.txt
File metadata and controls
117 lines (98 loc) · 2.15 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
cmake_minimum_required(VERSION 3.16)
project(alg-app-store VERSION 0.2.28 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
# Find Qt6 packages
find_package(Qt6 REQUIRED COMPONENTS
Core
Gui
Widgets
Network
Concurrent
)
# Find libalpm
find_package(PkgConfig REQUIRED)
pkg_check_modules(ALPM REQUIRED libalpm)
# Include directories
include_directories(
${CMAKE_SOURCE_DIR}/src
${ALPM_INCLUDE_DIRS}
)
# Source files
set(SOURCES
src/main.cpp
# Core
src/core/alpm_wrapper.cpp
src/core/aur_helper.cpp
src/core/package_manager.cpp
# GUI
src/gui/mainwindow.cpp
src/gui/home_widget.cpp
src/gui/search_widget.cpp
src/gui/installed_widget.cpp
src/gui/updates_widget.cpp
src/gui/settings_widget.cpp
src/gui/package_card.cpp
src/gui/package_details_dialog.cpp
)
# Header files
set(HEADERS
src/utils/logger.h
src/utils/types.h
# Core
src/core/alpm_wrapper.h
src/core/aur_helper.h
src/core/package_manager.h
# GUI
src/gui/mainwindow.h
src/gui/home_widget.h
src/gui/search_widget.h
src/gui/installed_widget.h
src/gui/updates_widget.h
src/gui/settings_widget.h
src/gui/package_card.h
src/gui/package_details_dialog.h
)
# Create executable
add_executable(${PROJECT_NAME}
${SOURCES}
${HEADERS}
)
# Link libraries
target_link_libraries(${PROJECT_NAME} PRIVATE
Qt6::Core
Qt6::Gui
Qt6::Widgets
Qt6::Network
Qt6::Concurrent
${ALPM_LIBRARIES}
)
# Link directories
link_directories(${ALPM_LIBRARY_DIRS})
# Compiler flags
target_compile_options(${PROJECT_NAME} PRIVATE
-Wall
-Wextra
-Wpedantic
)
# Install target
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin
)
# Install desktop file
install(FILES assets/alg-app-store.desktop
DESTINATION share/applications
)
# Copy stylesheet to build directory
configure_file(
${CMAKE_SOURCE_DIR}/stylesheet.qss
${CMAKE_BINARY_DIR}/stylesheet.qss
COPYONLY
)
# Install stylesheet
install(FILES stylesheet.qss
DESTINATION share/alg-app-store
)