-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
114 lines (96 loc) · 2.68 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
cmake_minimum_required(VERSION 3.22)
project(damping-dolphin)
set(COMPILE_TBB OFF CACHE BOOL "Compile TBB")
set(QT_PATH "$ENV{HOME}/Qt5.12.12/5.12.12/gcc_64/lib/cmake" CACHE STRING "Path to Qt")
set(CMAKE_PREFIX_PATH "${QT_PATH}")
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOUIC_SEARCH_PATHS form)
set(CMAKE_CXX_STANDARD 14)
add_compile_definitions(ARMA_DONT_USE_ATLAS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations -Wno-implicit-fallthrough")
if (UNIX)
add_compile_definitions(ARMA_USE_OPENMP)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
endif ()
if (UNIX)
link_directories(lib/linux)
elseif (MSVC)
link_directories(lib/win-msvc)
else ()
link_directories(lib/win-gcc)
endif ()
include_directories(include)
include_directories(include/QCustomPlot)
find_package(Qt5 COMPONENTS
Core
Gui
Widgets
PrintSupport
)
find_package(Qt6 COMPONENTS
Core
Gui
Widgets
PrintSupport
)
if (NOT Qt5_FOUND AND NOT Qt6_FOUND)
message(FATAL_ERROR "Qt not found")
endif ()
set(SOURCES
src/FitSetting.cpp
include/QCustomPlot/qcustomplot.cpp
src/About.cpp
src/Guide.cpp
src/damping-dolphin.cpp
src/DampingCurve.cpp
src/DampingMode.cpp
src/MainWindow.cpp
src/Scheme/ObjectiveFunction.cpp
src/Scheme/ThreeWiseMen.cpp
src/Scheme/Unicorn.cpp
src/Scheme/TwoCities.cpp
src/Scheme/ZeroDay.cpp
)
set(UIS
form/About.ui
form/FitSetting.ui
form/Guide.ui
form/MainWindow.ui
)
set(RESOURCES
res/res.qrc
)
add_executable(${PROJECT_NAME} ${UIS} ${SOURCES} ${RESOURCES})
if (Qt6_FOUND)
target_link_libraries(${PROJECT_NAME}
Qt6::Core
Qt6::Gui
Qt6::Widgets
Qt6::PrintSupport
openblas
)
else ()
target_link_libraries(${PROJECT_NAME}
Qt5::Core
Qt5::Gui
Qt5::Widgets
Qt5::PrintSupport
openblas
)
endif ()
if (UNIX)
target_link_libraries(damping-dolphin gfortran quadmath gomp pthread)
endif ()
if (UNIX)
add_compile_definitions(DD_TBB_ENABLED)
if (COMPILE_TBB)
set(TBB_TEST OFF CACHE BOOL "Override option" FORCE)
set(TBB_DISABLE_HWLOC_AUTOMATIC_SEARCH OFF CACHE BOOL "Override option" FORCE)
add_subdirectory(oneTBB)
include_directories(oneTBB/include)
add_dependencies(${PROJECT_NAME} TBB::tbb TBB::tbbmalloc TBB::tbbmalloc_proxy)
endif ()
target_link_libraries(${PROJECT_NAME} tbb tbbmalloc tbbmalloc_proxy)
endif ()