CMakeLists.txt 9.14 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
set(SRC_FILES
    src/AddPeakHKL.cpp
    src/AnvredCorrection.cpp
    src/CalculatePeaksHKL.cpp
    src/CalculateUMatrix.cpp
    src/CalibrationHelpers.cpp
    src/CentroidPeaks.cpp
    src/ClearUB.cpp
    src/Cluster.cpp
    src/ClusterRegister.cpp
    src/CombinePeaksWorkspaces.cpp
    src/CompositeCluster.cpp
    src/ConnectedComponentLabeling.cpp
14
    src/ConvertPeaksWorkspace.cpp
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
    src/CountReflections.cpp
    src/DiffPeaksWorkspaces.cpp
    src/DisjointElement.cpp
    src/FilterPeaks.cpp
    src/FindClusterFaces.cpp
    src/FindSXPeaks.cpp
    src/FindSXPeaksHelper.cpp
    src/FindUBUsingFFT.cpp
    src/FindUBUsingIndexedPeaks.cpp
    src/FindUBUsingLatticeParameters.cpp
    src/FindUBUsingMinMaxD.cpp
    src/GoniometerAnglesFromPhiRotation.cpp
    src/HardThresholdBackground.cpp
    src/HasUB.cpp
    src/IndexPeaks.cpp
    src/IndexSXPeaks.cpp
    src/IntegratePeakTimeSlices.cpp
    src/IntegratePeaksHybrid.cpp
    src/IntegratePeaksUsingClusters.cpp
    src/LoadHKL.cpp
    src/LoadIsawPeaks.cpp
    src/LoadIsawSpectrum.cpp
    src/LoadIsawUB.cpp
    src/MaskPeaksWorkspace.cpp
    src/NormaliseVanadium.cpp
    src/OptimizeCrystalPlacement.cpp
    src/OptimizeLatticeForCellType.cpp
42
    src/PeakAlgorithmHelpers.cpp
43
44
45
46
47
48
49
50
51
52
53
54
55
    src/PeakBackground.cpp
    src/PeakClusterProjection.cpp
    src/PeakHKLErrors.cpp
    src/PeakIntegration.cpp
    src/PeakIntensityVsRadius.cpp
    src/PeakStatisticsTools.cpp
    src/PeaksInRegion.cpp
    src/PeaksIntersection.cpp
    src/PeaksOnSurface.cpp
    src/PredictFractionalPeaks.cpp
    src/PredictPeaks.cpp
    src/PredictSatellitePeaks.cpp
    src/SCDCalibratePanels.cpp
56
57
    src/SCDCalibratePanels2.cpp
    src/SCDCalibratePanels2ObjFunc.cpp
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
    src/SCDPanelErrors.cpp
    src/SaveHKL.cpp
    src/SaveIsawPeaks.cpp
    src/SaveIsawUB.cpp
    src/SaveLauenorm.cpp
    src/SelectCellOfType.cpp
    src/SelectCellWithForm.cpp
    src/SetCrystalLocation.cpp
    src/SetGoniometer.cpp
    src/SetSpecialCoordinates.cpp
    src/SetUB.cpp
    src/ShowPeakHKLOffsets.cpp
    src/ShowPossibleCells.cpp
    src/SortHKL.cpp
    src/SortPeaksWorkspace.cpp
    src/StatisticsOfPeaksWorkspace.cpp
    src/TransformHKL.cpp)
75

76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
set(SRC_UNITY_IGNORE_FILES)
set(INC_FILES
    inc/MantidCrystal/AddPeakHKL.h
    inc/MantidCrystal/AnvredCorrection.h
    inc/MantidCrystal/BackgroundStrategy.h
    inc/MantidCrystal/CalculatePeaksHKL.h
    inc/MantidCrystal/CalculateUMatrix.h
    inc/MantidCrystal/CalibrationHelpers.h
    inc/MantidCrystal/CentroidPeaks.h
    inc/MantidCrystal/ClearUB.h
    inc/MantidCrystal/Cluster.h
    inc/MantidCrystal/ClusterRegister.h
    inc/MantidCrystal/CombinePeaksWorkspaces.h
    inc/MantidCrystal/CompositeCluster.h
    inc/MantidCrystal/ConnectedComponentLabeling.h
91
    inc/MantidCrystal/ConvertPeaksWorkspace.h
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
    inc/MantidCrystal/CountReflections.h
    inc/MantidCrystal/DiffPeaksWorkspaces.h
    inc/MantidCrystal/DisjointElement.h
    inc/MantidCrystal/FilterPeaks.h
    inc/MantidCrystal/FindClusterFaces.h
    inc/MantidCrystal/FindSXPeaks.h
    inc/MantidCrystal/FindSXPeaksHelper.h
    inc/MantidCrystal/FindUBUsingFFT.h
    inc/MantidCrystal/FindUBUsingIndexedPeaks.h
    inc/MantidCrystal/FindUBUsingLatticeParameters.h
    inc/MantidCrystal/FindUBUsingMinMaxD.h
    inc/MantidCrystal/GSLFunctions.h
    inc/MantidCrystal/GoniometerAnglesFromPhiRotation.h
    inc/MantidCrystal/HardThresholdBackground.h
    inc/MantidCrystal/HasUB.h
    inc/MantidCrystal/ICluster.h
    inc/MantidCrystal/IndexPeaks.h
    inc/MantidCrystal/IndexSXPeaks.h
    inc/MantidCrystal/IntegratePeakTimeSlices.h
    inc/MantidCrystal/IntegratePeaksHybrid.h
    inc/MantidCrystal/IntegratePeaksUsingClusters.h
    inc/MantidCrystal/LoadHKL.h
    inc/MantidCrystal/LoadIsawPeaks.h
    inc/MantidCrystal/LoadIsawSpectrum.h
    inc/MantidCrystal/LoadIsawUB.h
    inc/MantidCrystal/MaskPeaksWorkspace.h
    inc/MantidCrystal/NormaliseVanadium.h
    inc/MantidCrystal/OptimizeCrystalPlacement.h
    inc/MantidCrystal/OptimizeLatticeForCellType.h
121
    inc/MantidCrystal/PeakAlgorithmHelpers.h
122
123
124
125
126
127
128
129
130
131
132
133
134
    inc/MantidCrystal/PeakBackground.h
    inc/MantidCrystal/PeakClusterProjection.h
    inc/MantidCrystal/PeakHKLErrors.h
    inc/MantidCrystal/PeakIntegration.h
    inc/MantidCrystal/PeakIntensityVsRadius.h
    inc/MantidCrystal/PeakStatisticsTools.h
    inc/MantidCrystal/PeaksInRegion.h
    inc/MantidCrystal/PeaksIntersection.h
    inc/MantidCrystal/PeaksOnSurface.h
    inc/MantidCrystal/PredictFractionalPeaks.h
    inc/MantidCrystal/PredictPeaks.h
    inc/MantidCrystal/PredictSatellitePeaks.h
    inc/MantidCrystal/SCDCalibratePanels.h
135
136
    inc/MantidCrystal/SCDCalibratePanels2.h
    inc/MantidCrystal/SCDCalibratePanels2ObjFunc.h
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
    inc/MantidCrystal/SCDPanelErrors.h
    inc/MantidCrystal/SaveHKL.h
    inc/MantidCrystal/SaveIsawPeaks.h
    inc/MantidCrystal/SaveIsawUB.h
    inc/MantidCrystal/SaveLauenorm.h
    inc/MantidCrystal/SelectCellOfType.h
    inc/MantidCrystal/SelectCellWithForm.h
    inc/MantidCrystal/SetCrystalLocation.h
    inc/MantidCrystal/SetGoniometer.h
    inc/MantidCrystal/SetSpecialCoordinates.h
    inc/MantidCrystal/SetUB.h
    inc/MantidCrystal/ShowPeakHKLOffsets.h
    inc/MantidCrystal/ShowPossibleCells.h
    inc/MantidCrystal/SortHKL.h
    inc/MantidCrystal/SortPeaksWorkspace.h
    inc/MantidCrystal/StatisticsOfPeaksWorkspace.h
    inc/MantidCrystal/TransformHKL.h)
154

155
156
157
158
159
160
161
162
163
164
165
166
167
set(TEST_FILES
    AddPeakHKLTest.h
    AnvredCorrectionTest.h
    CalculatePeaksHKLTest.h
    CalculateUMatrixTest.h
    CalibrationHelpersTest.h
    CentroidPeaksTest.h
    ClearUBTest.h
    ClusterRegisterTest.h
    ClusterTest.h
    CombinePeaksWorkspacesTest.h
    CompositeClusterTest.h
    ConnectedComponentLabelingTest.h
168
    ConvertPeaksWorkspaceTest.h
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
    DiffPeaksWorkspacesTest.h
    DisjointElementTest.h
    FilterPeaksTest.h
    FindClusterFacesTest.h
    FindSXPeaksHelperTest.h
    FindSXPeaksTest.h
    FindUBUsingFFTTest.h
    FindUBUsingIndexedPeaksTest.h
    FindUBUsingLatticeParametersTest.h
    FindUBUsingMinMaxDTest.h
    GoniometerAnglesFromPhiRotationTest.h
    HardThresholdBackgroundTest.h
    HasUBTest.h
    IndexPeaksTest.h
    IndexSXPeaksTest.h
    IntegratePeakTimeSlicesTest.h
    IntegratePeaksHybridTest.h
    IntegratePeaksUsingClustersTest.h
    LoadHKLTest.h
    LoadIsawPeaksTest.h
    LoadIsawSpectrumTest.h
    LoadIsawUBTest.h
    MaskPeaksWorkspaceTest.h
    NormaliseVanadiumTest.h
    OptimizeCrystalPlacementTest.h
    OptimizeLatticeForCellTypeTest.h
    PeakBackgroundTest.h
    PeakClusterProjectionTest.h
    PeakHKLErrorsTest.h
    PeakIntegrationTest.h
    PeakIntensityVsRadiusTest.h
    PeakStatisticsToolsTest.h
    PeaksInRegionTest.h
    PeaksOnSurfaceTest.h
    PredictFractionalPeaksTest.h
    PredictPeaksTest.h
    PredictSatellitePeaksTest.h
Zhang, Chen's avatar
Zhang, Chen committed
206
    SCDCalibratePanels2Test.h
207
208
209
210
211
212
213
    SCDCalibratePanelsTest.h
    SaveHKLTest.h
    SaveIsawPeaksTest.h
    SaveIsawUBTest.h
    SaveLauenormTest.h
    SelectCellOfTypeTest.h
    SelectCellWithFormTest.h
214
    SetCrystalLocationTest.h
215
216
217
218
219
220
221
222
223
    SetGoniometerTest.h
    SetSpecialCoordinatesTest.h
    SetUBTest.h
    ShowPeakHKLOffsetsTest.h
    ShowPossibleCellsTest.h
    SortHKLTest.h
    SortPeaksWorkspaceTest.h
    StatisticsOfPeaksWorkspaceTest.h
    TransformHKLTest.h)
224
225
226
227
228
229

if(UNITY_BUILD)
  include(UnityBuild)
  enable_unity_build(Crystal SRC_FILES SRC_UNITY_IGNORE_FILES 10)
endif(UNITY_BUILD)

230
if(COVERAGE)
231
232
233
234
235
  foreach(loop_var ${SRC_FILES} ${INC_FILES})
    set_property(GLOBAL APPEND
                 PROPERTY COVERAGE_SRCS
                          "${CMAKE_CURRENT_SOURCE_DIR}/${loop_var}")
  endforeach(loop_var)
236
237
endif()

238
239
240
# Add a precompiled header where they are supported
enable_precompiled_headers(inc/MantidCrystal/PrecompiledHeader.h SRC_FILES)

241
# Add the target for this directory
242
add_library(Crystal ${SRC_FILES} ${INC_FILES})
243
244
245
246
247
248
249
add_library(Mantid::Crystal ALIAS Crystal)

target_include_directories(Crystal PUBLIC
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc>
		$<INSTALL_INTERFACE:include/Mantid>
)

250
# Set the name of the generated library
251
set_target_properties(Crystal PROPERTIES OUTPUT_NAME MantidCrystal)
252
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
253
254
255
256
257
258
  set_target_properties(Crystal
                        PROPERTIES INSTALL_RPATH
                                   "@loader_path/../Contents/MacOS/")
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
  set_target_properties(Crystal
                        PROPERTIES INSTALL_RPATH "\$ORIGIN/../${LIB_DIR}")
259
260
endif()

261
# Add to the 'Framework' group in VS
262
set_property(TARGET Crystal PROPERTY FOLDER "MantidFramework")
263

264
include_directories(inc)
265

Stephen's avatar
Stephen committed
266
target_link_libraries(Crystal PUBLIC Mantid::API Mantid::Geometry Mantid::Kernel PRIVATE Mantid::DataObjects Mantid::Indexing Boost::filesystem)
267

268
# Add the unit tests directory
269
add_subdirectory(test)
270

271
# Auto-generate exports header
272
target_include_directories(Crystal PUBLIC
Stephen's avatar
Stephen committed
273
274
275
  $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/Framework/Crystal>
  $<INSTALL_INTERFACE:include/Mantid>
)
276
277
generate_mantid_export_header(Crystal FALSE)

278
# Installation settings
279
if (CONDA_BUILD)
Stephen's avatar
Stephen committed
280
set(TARGET_EXPORT_NAME "MantidCrystalTargets")
281
282
283
284
285
286
287
288
mtd_install_framework_lib(TARGETS Crystal INSTALL_EXPORT_FILE EXPORT_NAME ${TARGET_EXPORT_NAME})
else()
mtd_install_targets(TARGETS
                    Crystal
                    INSTALL_DIRS
                    ${PLUGINS_DIR}
                    ${WORKBENCH_PLUGINS_DIR})
endif()