-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
82 lines (61 loc) · 2.21 KB
/
CMakeLists.txt
File metadata and controls
82 lines (61 loc) · 2.21 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
# Reference: https://doc.qt.io/qt-6/cmake-manual.html
cmake_minimum_required(VERSION 3.16)
# Add folder where are supportive functions
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
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)
# Include Qt basic functions
include(QtCommon)
# Basic information about project
project(ColorPicker)
# Set PROJECT_VERSION_PATCH and PROJECT_VERSION_TWEAK to 0 if not present, needed by add_project_meta
fix_project_version()
# Set additional project information
set(COMPANY "IDEOLOGIX Media")
set(COPYRIGHT "Copyright (c) 2022 Darko Gjorgjijoski. All rights reserved.")
set(IDENTIFIER "com.ideologix.colorpicker")
if (UNIX AND NOT APPLE)
set(SOURCE_FILES
src/main.cpp
src/mainwindow.cpp
src/pointercolor.cpp
src/qguiappcurrentscreen.cpp
src/desktopinfo.cpp
src/screengrabber.cpp
src/dialogabout.cpp
src/dialogstartupinfo.cpp
src/waylandoverlay.cpp
src/request.cpp
)
else ()
set(SOURCE_FILES
src/main.cpp
src/mainwindow.cpp
src/pointercolor.cpp
src/qguiappcurrentscreen.cpp
src/desktopinfo.cpp
src/screengrabber.cpp
src/dialogabout.cpp
src/dialogstartupinfo.cpp
)
endif ()
add_project_meta(META_FILES_TO_INCLUDE)
set(RESOURCE_FILES res/assets.qrc)
find_package(Qt6 COMPONENTS Widgets REQUIRED)
find_package(Qt6 COMPONENTS DBus REQUIRED)
find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED)
# source_group("UI Files" FILES ${UI_FILES})
add_executable(${PROJECT_NAME} ${OS_BUNDLE} # Expands to WIN32 or MACOS_BUNDLE depending on OS
${SOURCE_FILES} ${META_FILES_TO_INCLUDE} ${RESOURCE_FILES}
)
target_precompile_headers(${PROJECT_NAME} INTERFACE QtWidgets.h)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Widgets)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::DBus)
if (QT_VERSION_MAJOR EQUAL 6)
qt_finalize_executable(ColorPicker)
endif ()