-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
136 lines (113 loc) · 3.45 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
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
cmake_minimum_required(VERSION 3.13)
# Set project details
project(fluor VERSION 0.10.2 DESCRIPTION "Fluor executable")
# C++ version
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# CMAKE settings
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
# Set executable
add_executable(fluor
widgets/header/global.h
widgets/header/cache.h
widgets/src/cache.cpp
widgets/header/state_program.h
widgets/src/state_program.cpp
widgets/header/state_gui.h
widgets/src/state_gui.cpp
widgets/src/main.cpp
widgets/header/application.h
widgets/src/application.cpp
widgets/header/main_controller.h
widgets/src/main_controller.cpp
widgets/header/main_menu_bar.h
widgets/src/main_menu_bar.cpp
widgets/header/general_widgets.h
widgets/src/general_widgets.cpp
widgets/header/central_controller.h
widgets/src/central_controller.cpp
widgets/header/toolbar_controller.h
widgets/src/toolbar_controller.cpp
widgets/header/toolbar_buttons.h
widgets/src/toolbar_buttons.cpp
widgets/header/fluor_controller.h
widgets/src/fluor_controller.cpp
widgets/header/fluor_lineedit.h
widgets/src/fluor_lineedit.cpp
widgets/header/fluor_buttons.h
widgets/src/fluor_buttons.cpp
widgets/header/laser_controller.h
widgets/src/laser_controller.cpp
widgets/header/laser_lineedit.h
widgets/src/laser_lineedit.cpp
widgets/header/laser_buttons.h
widgets/src/laser_buttons.cpp
widgets/header/graph_controller.h
widgets/src/graph_controller.cpp
widgets/header/graph_graphicsscene.h
widgets/src/graph_graphicsscene.cpp
widgets/header/graph_format.h
widgets/src/graph_format.cpp
widgets/header/graph_graphicsview.h
widgets/src/graph_graphicsview.cpp
widgets/header/graph_graphicsitems.h
widgets/src/graph_graphicsitems.cpp
resources/resources.qrc
)
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set_target_properties(fluor PROPERTIES WIN32_EXECUTABLE true)
target_compile_definitions(fluor PRIVATE QT_DEBUG_NO_OUTPUT)
endif()
# set target properties
target_compile_options(fluor PRIVATE
-g
-Wall
-Wextra
-Wpedantic
-Wconversion
#-Wshadow
-Wsign-compare
-Wsign-conversion
-Wsign-promo
-Wnon-virtual-dtor
-Wold-style-cast
-Wunused
-Woverloaded-virtual
-Wnull-dereference
-Wdouble-promotion
-Wduplicated-cond
-Wduplicated-branches
-Wlogical-op
#-Wuseless-cast
)
set_target_properties(fluor PROPERTIES
# OUTPUT_NAME _data
VERSION ${PROJECT_VERSION}
)
# set include directories
target_include_directories(fluor PRIVATE widgets/header)
target_include_directories(fluor PRIVATE lib/public)
# Add packages
find_package(Qt5Core CONFIG REQUIRED)
find_package(Qt5Gui CONFIG REQUIRED)
find_package(Qt5Widgets CONFIG REQUIRED)
# Link libraries
target_link_libraries(fluor PRIVATE Qt5::Core)
target_link_libraries(fluor PRIVATE Qt5::Gui)
target_link_libraries(fluor PRIVATE Qt5::Widgets)
target_link_libraries(fluor PRIVATE ${PROJECT_SOURCE_DIR}/lib/build/lib_data.dll.a)
# Copy necessary files
add_custom_command(
TARGET fluor POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${PROJECT_SOURCE_DIR}/lib/build/lib_data.dll
$<TARGET_FILE_DIR:fluor>
)
add_custom_command(
TARGET fluor POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${PROJECT_SOURCE_DIR}/data
$<TARGET_FILE_DIR:fluor>/data
)