-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
85 lines (65 loc) · 1.72 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
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
cmake_minimum_required(VERSION 3.14)
include(cmake/prelude.cmake)
project(
compositing
VERSION 1.0.0
LANGUAGES CXX
)
include(cmake/project-is-top-level.cmake)
include(cmake/variables.cmake)
# ---- Declare library ----
set(QT_HEADERS
include/ui/listing.hxx
include/ui/menu.hxx
include/ui/settings.hxx
include/ui/viewer.hxx
include/ui/window.hxx
)
set(QT_SOURCES
source/ui/listing.cxx
source/ui/menu.cxx
source/ui/settings.cxx
source/ui/viewer.cxx
source/ui/window.cxx
)
set(CMAKE_AUTOMOC ON)
add_library(compositing_lib OBJECT
source/application.cxx
source/image/ppm.cxx
source/utils/builder.cxx
source/utils/loader.cxx
${QT_HEADERS}
${QT_SOURCES}
)
target_include_directories(
compositing_lib ${warning_guard}
PUBLIC
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
)
target_compile_features(compositing_lib PUBLIC cxx_std_20)
find_package(Qt6 COMPONENTS Core Gui Widgets REQUIRED)
target_link_libraries(compositing_lib PRIVATE
Qt6::Core
Qt6::Gui
Qt6::Widgets
)
# ---- Declare executable ----
add_executable(compositing_exe source/main.cxx)
add_executable(compositing::exe ALIAS compositing_exe)
set_property(TARGET compositing_exe PROPERTY OUTPUT_NAME compositing)
target_compile_features(compositing_exe PRIVATE cxx_std_20)
target_link_libraries(compositing_exe PRIVATE compositing_lib)
# ---- Install rules ----
if(NOT CMAKE_SKIP_INSTALL_RULES)
include(cmake/install-rules.cmake)
endif()
# ---- Developer mode ----
if(NOT compositing_DEVELOPER_MODE)
return()
elseif(NOT PROJECT_IS_TOP_LEVEL)
message(
AUTHOR_WARNING
"Developer mode is intended for developers of compositing"
)
endif()
include(cmake/dev-mode.cmake)