CMakeLists.txt 9.01 KB
Newer Older
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
set(SRC_FILES
    src/AffineMatrixParameter.cpp
    src/AffineMatrixParameterParser.cpp
    src/BoxControllerNeXusIO.cpp
    src/CoordTransformAffine.cpp
    src/CoordTransformAffineParser.cpp
    src/CoordTransformAligned.cpp
    src/CoordTransformDistance.cpp
    src/CoordTransformDistanceParser.cpp
    src/EventList.cpp
    src/EventWorkspace.cpp
    src/EventWorkspaceHelpers.cpp
    src/EventWorkspaceMRU.cpp
    src/Events.cpp
    src/FakeMD.cpp
    src/FractionalRebinning.cpp
    src/GroupingWorkspace.cpp
    src/Histogram1D.cpp
    src/MDBoxFlatTree.cpp
    src/MDBoxSaveable.cpp
    src/MDEventFactory.cpp
    src/MDFramesToSpecialCoordinateSystem.cpp
    src/MDHistoWorkspace.cpp
    src/MDHistoWorkspaceIterator.cpp
    src/MDLeanEvent.cpp
    src/MaskWorkspace.cpp
    src/MementoTableWorkspace.cpp
    src/NoShape.cpp
    src/OffsetsWorkspace.cpp
    src/Peak.cpp
31
    src/LeanElasticPeak.cpp
32
    src/BasePeak.cpp
33
34
35
36
37
38
39
40
    src/PeakColumn.cpp
    src/PeakNoShapeFactory.cpp
    src/PeakShapeBase.cpp
    src/PeakShapeEllipsoid.cpp
    src/PeakShapeEllipsoidFactory.cpp
    src/PeakShapeSpherical.cpp
    src/PeakShapeSphericalFactory.cpp
    src/PeaksWorkspace.cpp
41
    src/LeanElasticPeaksWorkspace.cpp
42
43
44
45
46
47
48
49
50
51
52
53
54
    src/PropertyWithValue.cpp
    src/RebinnedOutput.cpp
    src/ReflectometryTransform.cpp
    src/ScanningWorkspaceBuilder.cpp
    src/SpecialWorkspace2D.cpp
    src/SplittersWorkspace.cpp
    src/TableColumn.cpp
    src/TableWorkspace.cpp
    src/VectorColumn.cpp
    src/Workspace2D.cpp
    src/WorkspaceCreation.cpp
    src/WorkspaceProperty.cpp
    src/WorkspaceSingleValue.cpp)
55

56
57
58
59
set(SRC_UNITY_IGNORE_FILES
    src/Workspace2D.cpp
    src/WorkspaceSingleValue.cpp
    src/EventWorkspace.cpp)
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
set(INC_FILES
    inc/MantidDataObjects/AffineMatrixParameter.h
    inc/MantidDataObjects/AffineMatrixParameterParser.h
    inc/MantidDataObjects/BoxControllerNeXusIO.h
    inc/MantidDataObjects/CalculateReflectometry.h
    inc/MantidDataObjects/CalculateReflectometryKiKf.h
    inc/MantidDataObjects/CalculateReflectometryP.h
    inc/MantidDataObjects/CalculateReflectometryQxQz.h
    inc/MantidDataObjects/CoordTransformAffine.h
    inc/MantidDataObjects/CoordTransformAffineParser.h
    inc/MantidDataObjects/CoordTransformAligned.h
    inc/MantidDataObjects/CoordTransformDistance.h
    inc/MantidDataObjects/CoordTransformDistanceParser.h
    inc/MantidDataObjects/DllConfig.h
    inc/MantidDataObjects/EventList.h
    inc/MantidDataObjects/EventWorkspace.h
    inc/MantidDataObjects/EventWorkspaceHelpers.h
    inc/MantidDataObjects/EventWorkspaceMRU.h
    inc/MantidDataObjects/Events.h
    inc/MantidDataObjects/FakeMD.h
    inc/MantidDataObjects/FractionalRebinning.h
    inc/MantidDataObjects/GroupingWorkspace.h
    inc/MantidDataObjects/Histogram1D.h
    inc/MantidDataObjects/MDBin.h
    inc/MantidDataObjects/MDBin.tcc
    inc/MantidDataObjects/MDBox.h
    inc/MantidDataObjects/MDBox.tcc
    inc/MantidDataObjects/MDBoxBase.h
    inc/MantidDataObjects/MDBoxBase.tcc
    inc/MantidDataObjects/MDBoxFlatTree.h
    inc/MantidDataObjects/MDBoxIterator.h
    inc/MantidDataObjects/MDBoxIterator.tcc
    inc/MantidDataObjects/MDBoxSaveable.h
    inc/MantidDataObjects/MDDimensionStats.h
    inc/MantidDataObjects/MDEvent.h
    inc/MantidDataObjects/MDEventFactory.h
    inc/MantidDataObjects/MDEventInserter.h
    inc/MantidDataObjects/MDEventWorkspace.h
    inc/MantidDataObjects/MDEventWorkspace.tcc
    inc/MantidDataObjects/MDFramesToSpecialCoordinateSystem.h
    inc/MantidDataObjects/MDGridBox.h
    inc/MantidDataObjects/MDGridBox.tcc
    inc/MantidDataObjects/MDHistoWorkspace.h
    inc/MantidDataObjects/MDHistoWorkspaceIterator.h
    inc/MantidDataObjects/MDLeanEvent.h
    inc/MantidDataObjects/MaskWorkspace.h
    inc/MantidDataObjects/MortonIndex/BitInterleaving.h
    inc/MantidDataObjects/MortonIndex/CoordinateConversion.h
    inc/MantidDataObjects/MortonIndex/Types.h
Igor Gudich's avatar
Igor Gudich committed
110
    inc/MantidDataObjects/MementoTableWorkspace.h
111
112
113
    inc/MantidDataObjects/NoShape.h
    inc/MantidDataObjects/OffsetsWorkspace.h
    inc/MantidDataObjects/Peak.h
114
    inc/MantidDataObjects/LeanElasticPeak.h
115
    inc/MantidDataObjects/BasePeak.h
116
117
118
119
120
121
122
123
124
    inc/MantidDataObjects/PeakColumn.h
    inc/MantidDataObjects/PeakNoShapeFactory.h
    inc/MantidDataObjects/PeakShapeBase.h
    inc/MantidDataObjects/PeakShapeEllipsoid.h
    inc/MantidDataObjects/PeakShapeEllipsoidFactory.h
    inc/MantidDataObjects/PeakShapeFactory.h
    inc/MantidDataObjects/PeakShapeSpherical.h
    inc/MantidDataObjects/PeakShapeSphericalFactory.h
    inc/MantidDataObjects/PeaksWorkspace.h
125
    inc/MantidDataObjects/LeanElasticPeaksWorkspace.h
126
127
128
129
130
131
132
133
    inc/MantidDataObjects/RebinnedOutput.h
    inc/MantidDataObjects/ReflectometryTransform.h
    inc/MantidDataObjects/ScanningWorkspaceBuilder.h
    inc/MantidDataObjects/SkippingPolicy.h
    inc/MantidDataObjects/SpecialWorkspace2D.h
    inc/MantidDataObjects/SplittersWorkspace.h
    inc/MantidDataObjects/TableColumn.h
    inc/MantidDataObjects/TableWorkspace.h
Stephen's avatar
Stephen committed
134
    inc/MantidDataObjects/TableWorkspace_fwd.h
135
136
    inc/MantidDataObjects/VectorColumn.h
    inc/MantidDataObjects/Workspace2D.h
Stephen's avatar
Stephen committed
137
    inc/MantidDataObjects/Workspace2D_fwd.h
138
139
    inc/MantidDataObjects/WorkspaceCreation.h
    inc/MantidDataObjects/WorkspaceSingleValue.h)
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
set(TEST_FILES
    AffineMatrixParameterParserTest.h
    AffineMatrixParameterTest.h
    BoxControllerNeXusIOTest.h
    CoordTransformAffineParserTest.h
    CoordTransformAffineTest.h
    CoordTransformAlignedTest.h
    CoordTransformDistanceParserTest.h
    CoordTransformDistanceTest.h
    EventListTest.h
    EventWorkspaceMRUTest.h
    EventWorkspaceTest.h
    EventsTest.h
    FakeMDTest.h
    GroupingWorkspaceTest.h
    Histogram1DTest.h
    MDBinTest.h
    MDBoxBaseTest.h
    MDBoxFlatTreeTest.h
    MDBoxIteratorTest.h
    MDBoxSaveableTest.h
    MDBoxTest.h
    MDDimensionStatsTest.h
    MDEventFactoryTest.h
    MDEventInserterTest.h
    MDEventTest.h
    MDEventWorkspaceTest.h
    MDFramesToSpecialCoordinateSystemTest.h
    MDGridBoxTest.h
    MDHistoWorkspaceIteratorTest.h
    MDHistoWorkspaceTest.h
    MDLeanEventTest.h
    MaskWorkspaceTest.h
    MementoTableWorkspaceTest.h
    NoShapeTest.h
    OffsetsWorkspaceTest.h
    PeakColumnTest.h
    PeakNoShapeFactoryTest.h
    PeakShapeEllipsoidFactoryTest.h
    PeakShapeEllipsoidTest.h
    PeakShapeSphericalFactoryTest.h
    PeakShapeSphericalTest.h
    PeakTest.h
184
    LeanElasticPeakTest.h
185
    PeaksWorkspaceTest.h
186
    LeanElasticPeaksWorkspaceTest.h
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
    RebinnedOutputTest.h
    RefAxisTest.h
    ReflectometryTransformTest.h
    ScanningWorkspaceBuilderTest.h
    SkippingPolicyTest.h
    SpecialWorkspace2DTest.h
    SplittersWorkspaceTest.h
    TableColumnTest.h
    TableWorkspacePropertyTest.h
    TableWorkspaceTest.h
    VectorColumnTest.h
    WeightedEventNoTimeTest.h
    WeightedEventTest.h
    Workspace2DTest.h
    WorkspaceCreationTest.h
    WorkspaceSingleValueTest.h
    WorkspaceValidatorsTest.h
    MortonIndex/BitInterleavingTest.h)
205

206
207
if(UNITY_BUILD)
  include(UnityBuild)
208
  enable_unity_build(DataObjects SRC_FILES SRC_UNITY_IGNORE_FILES 10)
209
210
endif(UNITY_BUILD)

211
if(COVERAGE)
212
213
214
215
216
  foreach(loop_var ${SRC_FILES} ${INC_FILES})
    set_property(GLOBAL APPEND
                 PROPERTY COVERAGE_SRCS
                          "${CMAKE_CURRENT_SOURCE_DIR}/${loop_var}")
  endforeach(loop_var)
217
218
endif()

219
# Use a precompiled header where they are supported
220
enable_precompiled_headers(inc/MantidDataObjects/PrecompiledHeader.h SRC_FILES)
221
# Add the target for this directory
222
add_library(DataObjects ${SRC_FILES} ${INC_FILES})
223
224
225
226
227
228
add_library(Mantid::DataObjects ALIAS DataObjects)

target_include_directories(DataObjects PUBLIC
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc>
		$<INSTALL_INTERFACE:include/Mantid>
)
Stephen's avatar
Stephen committed
229

230
# Set the name of the generated library
231
232
233
234
set_target_properties(DataObjects PROPERTIES
                      OUTPUT_NAME
                        MantidDataObjects
                      COMPILE_DEFINITIONS
Stephen's avatar
Stephen committed
235
                        IN_MANTID_DATAOBJECTS)
236

237
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
238
  set_target_properties(DataObjects
239
                        PROPERTIES INSTALL_RPATH "@loader_path/../MacOS;@loader_path/../Frameworks")
240
241
242
243
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
  set_target_properties(DataObjects
                        PROPERTIES INSTALL_RPATH "\$ORIGIN/../${LIB_DIR}")
endif()
Martyn Gigg's avatar
Martyn Gigg committed
244

245
246
247
248
249
# Intensive use of templated libaries can cause large objects to be generated.
# These require an additional flag in MSVC.
if(MSVC)
  set_target_properties(DataObjects PROPERTIES COMPILE_FLAGS "/bigobj")
endif()
Martyn Gigg's avatar
Martyn Gigg committed
250

251
# Add to the 'Framework' group in VS
252
set_property(TARGET DataObjects PROPERTY FOLDER "MantidFramework")
253

254
target_link_libraries(DataObjects PUBLIC Mantid::API Mantid::Geometry Mantid::HistogramData Mantid::Kernel PRIVATE Mantid::Json Mantid::Indexing)
255

256
# Add the unit tests directory
257
add_subdirectory(test)
258
259

# Installation settings
260
if (CONDA_BUILD)
Stephen's avatar
Stephen committed
261
set(TARGET_EXPORT_NAME "MantidDataObjectsTargets")
262
263
264
265
266
267
268
269
mtd_install_framework_lib(TARGETS DataObjects EXPORT_NAME ${TARGET_EXPORT_NAME})
else()
mtd_install_targets(TARGETS
                    DataObjects
                    INSTALL_DIRS
                    ${LIB_DIR}
                    ${WORKBENCH_LIB_DIR})
endif()