-
Notifications
You must be signed in to change notification settings - Fork 24
/
CMakeLists.txt
161 lines (141 loc) · 4.69 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
cmake_minimum_required(VERSION 3.16)
project(volbx
LANGUAGES CXX
VERSION 2.1.0
DESCRIPTION "Graphical tool for data manipulation"
HOMEPAGE_URL "https://github.com/przemek83/volbx")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
find_package(Threads REQUIRED)
find_package(Qt6 REQUIRED COMPONENTS Widgets Core Gui Network Xml Test)
qt_standard_project_setup()
# QWT
if(DEFINED ENV{QWT_ROOT})
message(STATUS "QWT_ROOT environment variable defined, using QWT_ROOT paths.")
else()
configure_file(CMakeLists.txt.qwt qwt/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/qwt)
execute_process(COMMAND ${CMAKE_COMMAND} --build .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/qwt)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/qwt/install)
file(COPY ${CMAKE_BINARY_DIR}/qwt/qwt/src/qwt-build/lib DESTINATION ${CMAKE_BINARY_DIR}/qwt/install)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/qwt/install/include)
file(GLOB QWT_HEADERS "${CMAKE_BINARY_DIR}/qwt/qwt/src/qwt/src/*.h" )
file(COPY ${QWT_HEADERS} DESTINATION ${CMAKE_BINARY_DIR}/qwt/install/include)
set(ENV{QWT_ROOT} ${CMAKE_BINARY_DIR}/qwt/install/)
endif()
set(THIRD_PARTY_LIBS wble qwtble eible zlib quazip)
foreach(library ${THIRD_PARTY_LIBS})
configure_file(CMakeLists.txt.${library} ${library}/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G ${CMAKE_GENERATOR} .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${library})
execute_process(COMMAND ${CMAKE_COMMAND} --build .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${library} )
endforeach(library)
include_directories($ENV{QWT_ROOT}/include)
foreach(file_i ${THIRD_PARTY_LIBS})
include_directories(${CMAKE_BINARY_DIR}/${file_i}/install/include)
endforeach(file_i)
set(ZLIB_ROOT ${CMAKE_BINARY_DIR}/zlib/install)
find_package(ZLIB REQUIRED)
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_BINARY_DIR}/quazip/install/")
find_package(QuaZip-Qt6 CONFIG REQUIRED)
link_directories($ENV{QWT_ROOT}/lib)
link_directories(${CMAKE_BINARY_DIR}/zlib/install/bin)
link_directories(${CMAKE_BINARY_DIR}/quazip/install/lib)
link_directories(${CMAKE_BINARY_DIR}/wble/install/lib)
link_directories(${CMAKE_BINARY_DIR}/qwtble/install/lib)
link_directories(${CMAKE_BINARY_DIR}/eible/install/lib)
include_directories(${CMAKE_SOURCE_DIR})
include_directories(GUI)
include_directories(Import)
include_directories(Shared)
include_directories(Common)
include_directories(Datasets)
include_directories(ModelsAndViews)
include_directories(Export)
add_subdirectory(Shared)
add_subdirectory(Common)
add_subdirectory(Datasets)
add_subdirectory(ModelsAndViews)
add_subdirectory(Export)
set(SOURCES
Volbx/main.cpp
Volbx/Volbx.ico
Volbx/VolbxProperties.rc
GUI/About.cpp
GUI/CheckUpdates.cpp
GUI/DockTitleBar.cpp
GUI/Dock.cpp
GUI/Export.cpp
GUI/FiltersDock.cpp
GUI/Tab.cpp
GUI/TabWidget.cpp
GUI/PlotDock.cpp
GUI/SaveDatasetAs.cpp
GUI/TabBar.cpp
GUI/DataViewDock.cpp
GUI/VolbxMain.cpp
Import/ColumnsPreview.cpp
Import/DatasetVisualization.cpp
Import/DatasetImportTab.cpp
Import/DatasetsListBrowser.cpp
Import/ImportData.cpp
Import/ImportTab.cpp
Import/SpreadsheetsImportTab.cpp
)
qt_add_resources(SOURCES Resources/Resources.qrc)
set(HEADERS
Volbx/VolbxProperties.h
GUI/About.h
GUI/CheckUpdates.h
GUI/DockTitleBar.h
GUI/Dock.h
GUI/Export.h
GUI/FiltersDock.h
GUI/Tab.h
GUI/TabWidget.h
GUI/PlotDock.h
GUI/SaveDatasetAs.h
GUI/TabBar.h
GUI/DataViewDock.h
GUI/VolbxMain.h
Import/ColumnsPreview.h
Import/DatasetVisualization.h
Import/DatasetImportTab.h
Import/DatasetsListBrowser.h
Import/ImportData.h
Import/ImportTab.h
Import/SpreadsheetsImportTab.h
)
set(UI
GUI/About.ui
GUI/CheckUpdates.ui
GUI/DockTitleBar.ui
GUI/Export.ui
GUI/SaveDatasetAs.ui
GUI/VolbxMain.ui
Import/SpreadsheetsImportTab.ui
Import/DatasetsListBrowser.ui
Import/DatasetVisualization.ui
)
source_group("UI Files" FILES ${UI})
# remove background console window.
if(WIN32)
set(GUI_TYPE WIN32)
endif(WIN32)
if(APPLE)
set(GUI_TYPE MACOSX_BUNDLE)
endif(APPLE)
add_executable(${PROJECT_NAME} ${GUI_TYPE} ${SOURCES} ${HEADERS} ${UI})
target_link_libraries(${PROJECT_NAME} Threads::Threads shared common datasets modelsAndViews export wble qwtble eible Qt6::Core Qt6::Network Qt6::Widgets Qt6::Gui Qt6::Xml)
if(WIN32)
target_link_libraries(${PROJECT_NAME} optimized qwt debug qwtd)
else()
target_link_libraries(${PROJECT_NAME} qwt)
endif()
add_subdirectory(Update)
enable_testing()
add_subdirectory(Tests)