-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
73 lines (60 loc) · 1.78 KB
/
CMakeLists.txt
File metadata and controls
73 lines (60 loc) · 1.78 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
cmake_minimum_required(VERSION 3.16)
project(WallpaperMaker VERSION 1.0.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Find Qt6 components
find_package(Qt6 REQUIRED COMPONENTS Core Widgets Gui)
# Enable Qt's MOC (Meta-Object Compiler)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
# Set up source files
set(SOURCES
src/main.cpp
src/MainWindow.cpp
src/ImageViewer.cpp
src/ImageProcessor.cpp
src/SettingsDialog.cpp
)
set(HEADERS
src/MainWindow.h
src/ImageViewer.h
src/ImageProcessor.h
src/SettingsDialog.h
)
# Create the executable
add_executable(WallpaperMaker ${SOURCES} ${HEADERS})
# Link Qt6 libraries
target_link_libraries(WallpaperMaker Qt6::Core Qt6::Widgets Qt6::Gui)
# Platform-specific settings
if(WIN32)
set_target_properties(WallpaperMaker PROPERTIES
WIN32_EXECUTABLE TRUE
)
endif()
# Install target
install(TARGETS WallpaperMaker
RUNTIME DESTINATION bin
)
# Install .desktop file for Linux/FreeBSD desktop environments
if(UNIX AND NOT APPLE)
install(FILES WallpaperMaker.desktop
DESTINATION share/applications
)
# Install icon if it exists (optional)
if(EXISTS "${CMAKE_SOURCE_DIR}/icons/wallpapermaker.png")
install(FILES icons/wallpapermaker.png
DESTINATION share/icons/hicolor/256x256/apps
RENAME wallpapermaker.png
)
endif()
# Install smaller icon sizes if they exist
foreach(size 16 22 24 32 48 64 128)
if(EXISTS "${CMAKE_SOURCE_DIR}/icons/wallpapermaker-${size}.png")
install(FILES icons/wallpapermaker-${size}.png
DESTINATION share/icons/hicolor/${size}x${size}/apps
RENAME wallpapermaker.png
)
endif()
endforeach()
endif()