-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
235 lines (196 loc) · 7.61 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
cmake_minimum_required(VERSION 3.16)
#The Library name
project(NodeLink VERSION 1.0.0 LANGUAGES CXX)
# ##################################################################################################
# Project Settings
# ##################################################################################################
set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
list (APPEND QML_IMPORT_PATH ${CMAKE_CURRENT_SOURCE_DIR})
#message(${QML_IMPORT_PATH})
#Turns on default settings for development of NodeLink
set(DEVELOPER_DEFAULTS ON)
option(BUILD_TESTING "Build tests" ${DEVELOPER_DEFAULTS})
option(BUILD_EXAMPLES "Build Examples" ${DEVELOPER_DEFAULTS})
option(BUILD_SHARED_LIBS "Build as shared library" ON)
option(BUILD_DEBUG_POSTFIX_D "Append d suffix to debug libraries" OFF)
# ##################################################################################################
# Dependencies
# ##################################################################################################
# Find the Qt libraries
# QtQuickStream to save and load project.
add_subdirectory(QtQuickStream)
add_subdirectory(ColorPicker)
find_package(Qt6
COMPONENTS
Quick Concurrent
)
if (NOT Qt6_FOUND)
find_package(Qt5 QUIET
COMPONENTS
Quick
)
endif()
if (NOT (Qt6_FOUND OR Qt5_FOUND))
message(FATAL_ERRROR "Qt libraries were not found.")
endif()
if (Qt6_FOUND)
set(Qt Qt)
else()
set(Qt Qt5)
endif()
# ##################################################################################################
# Project Files
# ##################################################################################################
set(QT_QML_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/qml)
# Library Definition
qt_add_library(NodeLink STATIC)
# Extra QML File properties
set_source_files_properties(
resources/Core/NLCore.qml
resources/Core/NLSpec.qml
resources/Core/Undo/HashCompareString.qml
resources/View/NLStyle.qml
PROPERTIES
QT_QML_SINGLETON_TYPE True
)
qt_add_qml_module(NodeLink
URI "NodeLink"
VERSION 1.0
QML_FILES
resources/Core/NLCore.qml
resources/Core/NLSpec.qml
resources/Core/I_Node.qml
resources/Core/Node.qml
resources/Core/Port.qml
resources/Core/Scene.qml
resources/Core/SceneGuiConfig.qml
resources/Core/I_Scene.qml
resources/Core/SelectionModel.qml
resources/Core/NodeGuiConfig.qml
resources/Core/Link.qml
resources/Core/LinkGUIConfig.qml
resources/Core/I_NodeData.qml
resources/Core/NodeData.qml
resources/Core/NLNodeRegistry.qml
resources/Core/SelectionSpecificTool.qml
resources/Core/NLUtils.qml
resources/Core/ImagesModel.qml
resources/Core/Container.qml
resources/Core/ContainerGuiConfig.qml
resources/Core/Undo/UndoCore.qml
resources/Core/Undo/UndoStack.qml
resources/Core/Undo/UndoSceneObserver.qml
resources/Core/Undo/UndoNodeObserver.qml
resources/Core/Undo/UndoNodeGuiObserver.qml
resources/Core/Undo/UndoLinkObserver.qml
resources/Core/Undo/UndoContainerObserver.qml
resources/Core/Undo/UndoContainerGuiObserver.qml
resources/Core/Undo/HashCompareString.qml
resources/View/Components/Buttons/NLBaseButton.qml
resources/View/Components/Buttons/NLButton.qml
resources/View/Components/Buttons/NLIconButton.qml
resources/View/Components/Buttons/NLIconButtonRound.qml
resources/View/Components/Buttons/NLIconTextButton.qml
resources/View/Components/Buttons/NLSideMenuButton.qml
resources/View/Components/ColorPicker/ColorItem.qml
resources/View/Components/ColorPicker/ColorPicker.qml
resources/View/Components/NLPopUp.qml
resources/View/Components/NLTextArea.qml
resources/View/Components/NLTextField.qml
resources/View/Components/NLToolButton.qml
resources/View/Components/ConfirmPopUp.qml
resources/View/Components/SideMenuButtonGroup.qml
resources/View/Components/SideMenuButton.qml
resources/View/Components/ContextMenu.qml
resources/View/Components/ContextMenuItem.qml
resources/View/Components/NodeContextMenu.qml
resources/View/Components/NLToolTip.qml
resources/View/Components/VerticalScrollBar.qml
resources/View/Components/HorizontalScrollBar.qml
resources/View/Components/NLMenuItem.qml
resources/View/Components/NLRepeater.qml
resources/View/NLView.qml
resources/View/SceneSession.qml
resources/View/NLStyle.qml
resources/View/PortView.qml
resources/View/NodeView.qml
resources/View/NodesRect.qml
resources/View/I_NodesScene.qml
resources/View/I_NodesRect.qml
resources/View/I_NodeView.qml
resources/View/InteractiveNodeView.qml
resources/View/NodeViewOverview.qml
resources/View/NodesOverview.qml
resources/View/NodesRectOverview.qml
resources/View/LinkViewOverview.qml
resources/View/NodesScene.qml
resources/View/LinkView.qml
resources/View/I_LinkView.qml
resources/View/SceneViewBackground.qml
resources/View/ObjectSelectionView.qml
resources/View/Widgets/SideMenu.qml
resources/View/Widgets/SelectionToolsRect.qml
resources/View/Helpers/HelpersView.qml
resources/View/Helpers/SelectionHelperView.qml
resources/View/Helpers/LinkHelperView.qml
resources/View/ZoomManager.qml
resources/View/ImagesFlickable.qml
resources/View/ContainerView.qml
resources/View/ContainerOverview.qml
resources/View/ImageViewer.qml
resources/View/Logics/Calculation.js
resources/View/Logics/BasicLinkCalculator.js
resources/View/Logics/LinkPainter.js
SOURCES
include/NodeLink/Core/HashCompareStringCPP.h
Source/Core/HashCompareStringCPP.cpp
include/NodeLink/View/BackgroundGridsCPP.h
Source/View/BackgroundGridsCPP.cpp
Utils/NLUtilsCPP.h
Utils/NLUtilsCPP.cpp
RESOURCES
resources/fonts/Font\ Awesome\ 6\ Pro-Regular-400.otf
resources/fonts/Font\ Awesome\ 6\ Pro-Solid-900.otf
resources/Images/GridPoint.svg
)
include_directories(include/NodeLink/Core)
include_directories(include/NodeLink/View)
#Add a library to the project using the specified source file
#add_library(NodeLink::NodeLink ALIAS NodeLink)
target_include_directories(NodeLink
PUBLIC
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/resources>
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Source>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/NodeLink>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Utils>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/ColorPicker>
)
#Definitions of preprocessor macros
target_compile_definitions(NodeLink
PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
target_link_libraries(NodeLink
PRIVATE
${Qt}::Quick ${Qt}::Concurrent
QtQuickStreamplugin
ColorPickerplugin
)
set_target_properties(NodeLink PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
MACOSX_BUNDLE TRUE
WIN32_EXECUTABLE TRUE
)
install(TARGETS NodeLink
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
if(${BUILD_EXAMPLES})
add_subdirectory(examples)
endif()
if(BUILD_TESTING)
# add_subdirectory(test)
endif()