-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
158 lines (79 loc) · 4.65 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
cmake_minimum_required(VERSION 3.22)
project(App_Calibracao LANGUAGES C CXX VERSION 0.1)
set(EXE_NAME "Calibracao-${CMAKE_PROJECT_VERSION}")
add_executable(${EXE_NAME} "src/main.cpp")
if(CMAKE_GENERATOR MATCHES "Visual Studio 17")
message("-- Visual Studio Matched!!")
list(APPEND CMAKE_CXX_FLAGS "/O2" "/std:c++20")
endif()
target_compile_definitions(${EXE_NAME} PUBLIC LOW_FPS)
########################## -- Adding other source files -- ##########################
set(OTHER_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/GUI_to_application_processing.cpp")
list(APPEND OTHER_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/GUI_to_application_processing.h")
list(APPEND OTHER_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/thread_functions.cpp")
list(APPEND OTHER_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/thread_functions.h")
list(APPEND OTHER_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/Instrument.h")
list(APPEND OTHER_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/Instrument.cpp")
list(APPEND OTHER_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/FirstOrderInst.h")
list(APPEND OTHER_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/FirstOrderInst.cpp")
list(APPEND OTHER_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/entry_t.h")
list(APPEND OTHER_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/entry_t.cpp")
list(APPEND OTHER_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/senoidal_entry.h")
list(APPEND OTHER_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/senoidal_entry.cpp")
#message("IMGUI_SOURCES = ${IMGUI_SOURCES}")
target_include_directories(${EXE_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/src")
target_sources(${EXE_NAME} PUBLIC ${OTHER_SOURCES})
##############################################################################
########################## -- IMGUI Section -- ##########################
set(IMGUI_LIB "ImGUI")
set(IMGUI_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/vendor/imgui.cpp")
list(APPEND IMGUI_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/vendor/imgui_demo.cpp")
list(APPEND IMGUI_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/vendor/imgui_draw.cpp")
list(APPEND IMGUI_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/vendor/imgui_tables.cpp")
list(APPEND IMGUI_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/vendor/imgui_widgets.cpp")
list(APPEND IMGUI_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/vendor/imgui_impl_glfw.cpp")
list(APPEND IMGUI_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/vendor/imgui_impl_opengl3.cpp")
#message("IMGUI_SOURCES = ${IMGUI_SOURCES}")
add_library(${IMGUI_LIB} STATIC ${IMGUI_SOURCES})
target_compile_definitions(${IMGUI_LIB} PUBLIC GLEW_STATIC)
target_link_libraries(${EXE_NAME} PUBLIC ${IMGUI_LIB})
target_compile_definitions(${EXE_NAME} PUBLIC GLEW_STATIC)
##############################################################################
######################### -- IMPlot source files -- ##########################
set(IMPLOT "ImPlot")
set(IMPLOT_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/vendor/implot.cpp")
list(APPEND IMPLOT_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/vendor/implot_items.cpp")
#message("IMGUI_SOURCES = ${IMGUI_SOURCES}")
add_library(${IMPLOT} STATIC ${IMPLOT_SOURCES})
target_link_libraries(${IMPLOT} PUBLIC ${IMGUI_LIB})
target_link_libraries(${EXE_NAME} PUBLIC ${IMPLOT})
##############################################################################
#including the vendor folder as a include folder
target_include_directories(${EXE_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/src/vendor")
##################### -- Other dependencies root path -- #####################
set(DEPENDENCIES_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/dependencies)
set(GLEW "${DEPENDENCIES_ROOT_PATH}/GLEW")
set(GLFW "${DEPENDENCIES_ROOT_PATH}/GLFW")
set(DEPENDENCIES_PATH_LIST ${GLEW})
list(APPEND DEPENDENCIES_PATH_LIST ${GLFW})
foreach(DEP_PATH ${DEPENDENCIES_PATH_LIST})
#message("current path = ${DEP_PATH}")
target_include_directories(${IMGUI_LIB} PUBLIC "${DEP_PATH}/include")
target_link_directories(${IMGUI_LIB} PUBLIC "${DEP_PATH}/lib")
target_include_directories(${EXE_NAME} PUBLIC "${DEP_PATH}/include")
target_link_directories(${EXE_NAME} PUBLIC "${DEP_PATH}/lib")
endforeach()
##############################################################################
##################### -- Other dependencies lib names -- #####################
set(DEPENDENCIES_LIBS glfw3)
list(APPEND DEPENDENCIES_LIBS glew32s)
list(APPEND DEPENDENCIES_LIBS opengl32)
foreach(LIB ${DEPENDENCIES_LIBS})
#message("LIB = ${LIB}")
target_link_libraries(${IMGUI_LIB} PUBLIC ${LIB})
target_link_libraries(${EXE_NAME} PUBLIC ${LIB})
endforeach()
##############################################################################
#set(AUX a)
#get_target_property(AUX ${EXE_NAME} INCLUDE_DIRECTORIES)
#message("INCLUDE_DIRS = ${AUX}")