-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
227 lines (190 loc) · 7.15 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
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
file(STRINGS "version.txt" VERSION_STRING)
project (SyntheticSeismic LANGUAGES CXX VERSION ${VERSION_STRING})
add_definitions(-D_USE_MATH_DEFINES)
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
list(REMOVE_DUPLICATES CMAKE_PREFIX_PATH)
if(EXISTS ${CMAKE_SOURCE_DIR}/CMakeLists.config)
include(${CMAKE_SOURCE_DIR}/CMakeLists.config)
endif()
message("*********************************************************")
message("${CMAKE_PREFIX_PATH}")
set(SyntheticSeismic_ROOT ${CMAKE_INSTALL_PREFIX})
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(GTEST_LINKED_AS_SHARED_LIBRARY 1)
add_definitions(-DBOOST_BIND_GLOBAL_PLACEHOLDERS)
find_package(OpenMP)
find_package(Qt5 COMPONENTS REQUIRED Core Test Widgets)
find_package(CGAL REQUIRED COMPONENTS Core)
find_package(Threads REQUIRED)
find_package(GMP REQUIRED)
find_package(GTest CONFIG REQUIRED)
include_directories(${GTEST_INCLUDE_DIR})
include_directories(${HDF5_INCLUDE_DIRS})
# FIXME Retirar essa aberração.
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
FILE(GLOB SyntheticSeis_UI "console/*.ui")
qt5_wrap_ui(
Plugin_UI_HEADERS
${SyntheticSeis_UI}
)
add_library(SyntheticSeismic SHARED
# geometry
geometry/src/Coordinate.cpp
geometry/src/EnumUnit.cpp
geometry/src/Point3D.cpp
geometry/src/Volume.cpp
geometry/src/Point2D.cpp
# domain
domain/src/ConvertRegularGridCalculator.cpp
domain/src/ConvolutionRegularGridCalculator.cpp
domain/src/DomainConstant.cpp
domain/src/EclipseGridSurface.cpp
domain/src/EquationPlane.cpp
domain/src/ExtractMinimumRectangle2D.cpp
domain/src/ExtractVolumes.cpp
domain/src/Facade.cpp
domain/src/EclipseGrid.cpp
domain/src/GrdSurface.cpp
domain/src/Lithology.cpp
domain/src/LithologyDictionary.cpp
domain/src/ImpedanceRegularGridCalculator.cpp
domain/src/RegularGrid.cpp
domain/src/ReflectivityRegularGridCalculator.cpp
domain/src/RickerWaveletCalculator.cpp
domain/src/RotateVolumeCoordinate.cpp
domain/src/SeismicTraces.cpp
domain/src/VolumeToRegularGrid.cpp
domain/src/Wavelet.cpp
# storage
storage/src/Facade.cpp
storage/src/RegularGridHdf5Storage.cpp
storage/src/reader/EclipseGridReader.cpp
storage/src/reader/GrdSurfaceReader.cpp
storage/src/writer/EclipseGridWriter.cpp
storage/src/writer/SegyWriter.cpp
storage/src/writer/GrdSurfaceWriter.cpp
# infrastructure
infrastructure/src/OperatingSystemCommand.cpp
)
qt5_add_resources(RESOURCES console/images/SyntheticSeisApp.qrc)
add_library(SyntheticSeismicMock
# geometry
geometry/mock/GeometryMock.cpp
# domain
domain/mock/DomainMock.h
# storage
storage/mock/StorageMock.cpp
)
add_executable(SyntheticSeismicTest
cmake/TestMain.cpp
geometry/test/GeometryTest.cpp
domain/test/DomainTestValues.cpp
domain/test/DomainTest.cpp
domain/test/ConvertRegularGridCalculatorTest.cpp
domain/test/ConvolutionRegularGridCalculatorTest.cpp
storage/test/StorageTestValues.cpp
storage/test/StorageTest.cpp
domain/test/ConvertRegularGridToMetersCalculatorTest.cpp
domain/test/ConvertRegularGridTestValues.cpp
)
add_executable(SyntheticSeismicConsole
console/main.cpp
console/Wizard.cpp
${Plugin_UI_HEADERS}
${RESOURCES}
)
#add_library(SyntheticSeismicCoreTest SHARED test/CoreTest.cpp)
include(GenerateExportHeader)
generate_export_header(SyntheticSeismic BASE_NAME SyntheticSeismic)
target_link_libraries(SyntheticSeismic
PUBLIC Qt5::Core
PUBLIC OpenMP::OpenMP_CXX
PUBLIC ${GMP_LIBRARIES}/gmp.lib
PUBLIC CGAL::CGAL
PUBLIC CGAL::CGAL_Core
PUBLIC ${HDF5_LIBRARIES}
PUBLIC ${GTEST_LIBRARIES}
)
target_link_libraries(SyntheticSeismicMock
PUBLIC Qt5::Core
PUBLIC ${GMP_LIBRARIES}/gmp.lib
PUBLIC CGAL::CGAL
PUBLIC CGAL::CGAL_Core
PUBLIC ${HDF5_LIBRARIES}
PUBLIC SyntheticSeismic
)
target_link_libraries(SyntheticSeismicTest
PUBLIC Qt5::Core
PUBLIC Qt5::Test
PUBLIC ${GMP_LIBRARIES}/gmp.lib
PUBLIC CGAL::CGAL
PUBLIC CGAL::CGAL_Core
PUBLIC SyntheticSeismic
PUBLIC SyntheticSeismicMock
PUBLIC ${HDF5_LIBRARIES}
PUBLIC GTest::gtest GTest::gtest_main GTest::gmock GTest::gmock_main
)
target_link_libraries(SyntheticSeismicConsole
PUBLIC Qt5::Core
PUBLIC Qt5::Test
PUBLIC Qt5::Widgets
PUBLIC SyntheticSeismic
PUBLIC SyntheticSeismicMock
PUBLIC ${HDF5_LIBRARIES}
PUBLIC GTest::gtest GTest::gtest_main GTest::gmock GTest::gmock_main
)
if(WIN32)
include(GetPrerequisites)
#get_filename_component(@_package_upper_name@_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
set(SEARCH_PREFIX_PATH "${GTest_ROOT}/lib" ${Qt5_DIR})
message("Qt dir: ${Qt5_DIR} \n\n")
get_cmake_property(_variableNames VARIABLES)
foreach(_variableName ${_variableNames})
message("${_variableName}=${${_variableName}}")
endforeach()
MESSAGE(STATUS "SEARCH_PREFIX_PATH: ${SEARCH_PREFIX_PATH}")
set(_search_paths "${CMAKE_PREFIX_PATH};${CMAKE_BINARY_DIR}/bin;${SEARCH_PREFIX_PATH}")
string(REPLACE ";" "%3b" _search_paths "${_search_paths}")
message(STATUS "SEARCH_PATHS: " ${_search_paths})
add_custom_command(TARGET SyntheticSeismicTest
POST_BUILD
COMMAND ${CMAKE_COMMAND}
#COMMAND copy_if_different
-DTARGET_EXEC_NAME=SyntheticSeismicTest.exe
-DTARGET_EXEC_DIR=${CMAKE_BINARY_DIR}/bin
-DPREREQUISITES_DEST_DIR=${CMAKE_BINARY_DIR}/bin
-DSEARCH_PATHS=${_search_paths}
-DTARGET_LOCAL_DEPS=$<TARGET_FILE:SyntheticSeismicTest>
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/ConfigureBuildPrerequisites.cmake
)
IF(CMAKE_BUILD_TYPE MATCHES Debug)
file(COPY "${Qt5_DIR}/../../../bin/Qt5Cored.dll" DESTINATION "${CMAKE_BINARY_DIR}/bin/")
else()
file(COPY "${Qt5_DIR}/../../../bin/Qt5Core.dll" DESTINATION "${CMAKE_BINARY_DIR}/bin/")
endif()
endif()
install(FILES README.md
version.txt
DESTINATION .
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
)
# Arquivo de execução Python
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/bin/python")
file(COPY "${CMAKE_SOURCE_DIR}/python/generate_segy.py" DESTINATION "${CMAKE_BINARY_DIR}/bin/python/")
# Arquivo para teste de leitura do EclipseGrid
file(COPY "${CMAKE_SOURCE_DIR}/storage/test/EclipseGridTest.grdecl" DESTINATION "${CMAKE_BINARY_DIR}/bin/")
file(COPY "${CMAKE_SOURCE_DIR}/storage/test/EclipseGridPerformanceTest.grdecl" DESTINATION "${CMAKE_BINARY_DIR}/bin/")
file(COPY "${CMAKE_SOURCE_DIR}/storage/test/gridMollesImpedance_5_5_5.h5" DESTINATION "${CMAKE_BINARY_DIR}/bin/")
file(COPY "${CMAKE_SOURCE_DIR}/storage/test/grdDsaaTest.grd" DESTINATION "${CMAKE_BINARY_DIR}/bin/")
enable_testing()
add_test(
NAME SyntheticSeismicTest
COMMAND SyntheticSeismicTest
)
if (EXISTS ${CMAKE_SOURCE_DIR}/CPackConfig.cmake)
include(${CMAKE_SOURCE_DIR}/CPackConfig.cmake)
endif()