-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
134 lines (118 loc) · 3.99 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
# Minimum version required to use Qt5 is CMake 3.1.0
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
project(Despeect)
# Enables C++11 and later
set(CMAKE_CXX_STANDARD 11)
## install Test
# place binaries and libraries according to GNU standards
include(GNUInstallDirs)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})
include(test-framework/cmake/googletest.cmake)
fetch_googletest(
${CMAKE_SOURCE_DIR}/test-framework/cmake
${CMAKE_SOURCE_DIR}/test-framework/build
)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
set(CMAKE_EXE_LINKER_FLAGS="-fprofile-arcs -ftest-coverage")
# --- CMake instructions required from Speect ---
# Sets ${spct_DIR} variable to the Speect engine path
set(spct_DIR SpeectLib/install/include/speect/engine)
# Load and run CMake code from the file given
include(${spct_DIR}/SpeectConf.cmake)
include_directories(${SPCT_INCLUDE_DIRS})
# --- CMake instructions required from Speect ---
# --- CMake instructions required from Qt ---
# Instruct CMake to run moc automatically when needed
set(CMAKE_AUTOMOC ON)
# Create code from a list of Qt designer ui files
set(CMAKE_AUTOUIC ON)
# Initialize the AUTORCC property on all the targets
set(CMAKE_AUTORCC ON)
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Find the QtWidgets library
find_package(Qt5Widgets CONFIG REQUIRED)
include_directories(${Qt5Widgets_INCLUDES}) # Useless ???
add_definitions(${Qt5Widgets_DEFINITIONS}) # Useless ???
set(CMAKE_CXX_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") # Useless ???
# --- CMake instructions required from Qt ---
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/source)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/header)
set( HEADERS
header/DSAdapter.hpp
header/DSRelation.hpp
header/DSItem.hpp
header/DSMainWindow.hpp
header/DSRelListModel.hpp
header/DSFlowControlDockWidget.hpp
header/DSRelationControlDockWidget.hpp
header/DSTreeModel.hpp
header/DSTreeItem.hpp
header/DSListModel.hpp
header/DSTextDockWidget.hpp
header/arc.hpp
header/graphmanager.hpp
header/id.hpp
header/node.hpp
header/line.hpp
header/processormanager.hpp
header/datanodemanager.hpp
)
# Qt's Meta-Object-Compiler, required if the class has Q_OBJECT macro
set( MOC_HEADERS
header/DSMainWindow.hpp
header/DSFlowControlDockWidget.hpp
header/DSRelationControlDockWidget.hpp
header/DSTreeModel.hpp
#header/DSTreeItem.hpp Do not inherit from QObject
header/DSRelListModel.hpp
header/DSListModel.hpp
header/DSTextDockWidget.hpp
header/arc.hpp
header/graphmanager.hpp
header/node.hpp
header/line.hpp
header/processormanager.hpp
header/datanodemanager.hpp
)
set( SOURCES
source/main.cpp
source/DSAdapter.cpp
source/DSRelation.cpp
source/DSItem.cpp
source/DSMainWindow.cpp
source/DSFlowControlDockWidget.cpp
source/DSRelationControlDockWidget.cpp
source/DSTreeModel.cpp
source/DSTreeItem.cpp
source/DSRelListModel.cpp
source/DSListModel.cpp
source/DSTextDockWidget.cpp
source/arc.cpp
source/graphmanager.cpp
source/id.cpp
source/node.cpp
source/line.cpp
source/processormanager.cpp
source/datanodemanager.cpp
)
add_executable(Despeect ${SOURCES} ${HEADERS} ${MOC_HEADERS})
find_library(libspct libspct.so HINTS ${spct_DIR}/../../../lib)
target_link_libraries( Despeect
${QT_LIBRARIES} # Useless ???
${Qt5Widgets_LIBRARIES}
${libspct}
)
target_include_directories( Despeect PUBLIC
#${CMAKE_CURRENT_SOURCE_DIR}/source # Useless ???
#${CMAKE_CURRENT_SOURCE_DIR}/header # Useless ???
${spct_DIR}
#INCLUDE_DIRECTORIES #Useless ??
)
## aggiunta Test
enable_testing()
add_subdirectory(Test)