CMakeLists.txt 21.1 KB
Newer Older
1
2
3
4
5
6
7
set(SRC_FILES
    src/ANN_complete.cpp
    src/ArrayBoundedValidator.cpp
    src/ArrayLengthValidator.cpp
    src/ArrayOrderedPairsValidator.cpp
    src/ArrayProperty.cpp
    src/Atom.cpp
8
    src/AttenuationProfile.cpp
9
10
    src/BinFinder.cpp
    src/BinaryStreamReader.cpp
11
    src/BinaryStreamWriter.cpp
12
13
14
15
16
17
18
    src/CPUTimer.cpp
    src/CatalogInfo.cpp
    src/ChecksumHelper.cpp
    src/CompositeValidator.cpp
    src/ComputeResourceInfo.cpp
    src/ConfigObserver.cpp
    src/ConfigPropertyObserver.cpp
Moore's avatar
Moore committed
19
    src/ConfigService.cpp
20
    src/DataItem.cpp
Moore's avatar
Moore committed
21
    src/DateAndTime.cpp
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
    src/DateAndTimeHelpers.cpp
    src/DateTimeValidator.cpp
    src/DateValidator.cpp
    src/DeltaEMode.cpp
    src/Diffraction.cpp
    src/DirectoryValidator.cpp
    src/DiskBuffer.cpp
    src/DllOpen.cpp
    src/EnabledWhenProperty.cpp
    src/EnvironmentHistory.cpp
    src/EqualBinsChecker.cpp
    src/ErrorReporter.cpp
    src/Exception.cpp
    src/FacilityInfo.cpp
    src/FileDescriptor.cpp
    src/FileValidator.cpp
    src/FilteredTimeSeriesProperty.cpp
    src/FloatingPointComparison.cpp
    src/FreeBlock.cpp
    src/GitHubApiHelper.cpp
    src/Glob.cpp
    src/ICatalogInfo.cpp
    src/IPropertyManager.cpp
    src/ISaveable.cpp
    src/IndexSet.cpp
    src/InstrumentInfo.cpp
    src/InternetHelper.cpp
    src/Interpolation.cpp
    src/InvisibleProperty.cpp
    src/LibraryManager.cpp
    src/LibraryWrapper.cpp
    src/LiveListenerInfo.cpp
    src/LogFilter.cpp
    src/LogParser.cpp
    src/Logger.cpp
    src/MDAxisValidator.cpp
    src/MDUnit.cpp
    src/MDUnitFactory.cpp
    src/MagneticIon.cpp
    src/MandatoryValidator.cpp
    src/MantidVersion.cpp
    src/MaskedProperty.cpp
    src/Material.cpp
    src/MaterialBuilder.cpp
    src/MaterialXMLParser.cpp
    src/Math/ChebyshevPolyFit.cpp
    src/Math/Distributions/ChebyshevPolynomial.cpp
    src/Math/Distributions/ChebyshevSeries.cpp
    src/Math/Optimization/SLSQPMinimizer.cpp
    src/Matrix.cpp
    src/MatrixProperty.cpp
    src/Memory.cpp
    src/MersenneTwister.cpp
    src/MultiFileNameParser.cpp
    src/MultiFileValidator.cpp
    src/NDRandomNumberGenerator.cpp
    src/NeutronAtom.cpp
    src/NexusDescriptor.cpp
80
    src/NexusHDF5Descriptor.cpp
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
    src/NullValidator.cpp
    src/OptionalBool.cpp
    src/ProgressBase.cpp
    src/Property.cpp
    src/PropertyHistory.cpp
    src/PropertyManager.cpp
    src/PropertyManagerDataService.cpp
    src/PropertyManagerOwner.cpp
    src/PropertyManagerProperty.cpp
    src/PropertyNexus.cpp
    src/PropertyWithValue.cpp
    src/PropertyWithValueJSON.cpp
    src/ProxyInfo.cpp
    src/PseudoRandomNumberGenerator.cpp
    src/Quat.cpp
    src/ReadLock.cpp
    src/RebinParamsValidator.cpp
    src/RegexStrings.cpp
    src/RemoteJobManager.cpp
100
    src/SimpleJSON.cpp
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
    src/SingletonHolder.cpp
    src/SobolSequence.cpp
    src/StartsWithValidator.cpp
    src/Statistics.cpp
    src/StdoutChannel.cpp
    src/StringContainsValidator.cpp
    src/StringTokenizer.cpp
    src/Strings.cpp
    src/TestChannel.cpp
    src/ThreadPool.cpp
    src/ThreadPoolRunnable.cpp
    src/ThreadSafeLogStream.cpp
    src/TimeSeriesProperty.cpp
    src/TimeSplitter.cpp
    src/Timer.cpp
Moore's avatar
Moore committed
116
    src/TopicInfo.cpp
117
118
119
120
121
122
123
124
125
126
127
128
129
130
    src/Unit.cpp
    src/UnitConversion.cpp
    src/UnitLabel.cpp
    src/UnitLabelTypes.cpp
    src/UsageService.cpp
    src/UserCatalogInfo.cpp
    src/UserStringParser.cpp
    src/Utils.cpp
    src/V2D.cpp
    src/V3D.cpp
    src/VMD.cpp
    src/VectorHelper.cpp
    src/VisibleWhenProperty.cpp
    src/WriteLock.cpp)
131

132
133
134
135
136
137
138
139
140
set(SRC_UNITY_IGNORE_FILES
    src/Atom.cpp
    src/NeutronAtom.cpp
    src/FacilityInfo.cpp
    src/FileValidator.cpp
    src/DirectoryValidator.cpp
    src/PropertyManager.cpp
    src/Unit.cpp
    src/System.cpp)
141

142
143
144
145
146
147
148
149
150
set(INC_FILES
    inc/MantidKernel/ANN/ANN.h
    inc/MantidKernel/ANN/ANNperf.h
    inc/MantidKernel/ANN/ANNx.h
    inc/MantidKernel/ArrayBoundedValidator.h
    inc/MantidKernel/ArrayLengthValidator.h
    inc/MantidKernel/ArrayOrderedPairsValidator.h
    inc/MantidKernel/ArrayProperty.h
    inc/MantidKernel/Atom.h
151
    inc/MantidKernel/AttenuationProfile.h
152
153
154
    inc/MantidKernel/BinFinder.h
    inc/MantidKernel/BinaryFile.h
    inc/MantidKernel/BinaryStreamReader.h
155
    inc/MantidKernel/BinaryStreamWriter.h
156
157
158
159
160
161
162
163
164
165
166
167
    inc/MantidKernel/BoundedValidator.h
    inc/MantidKernel/CPUTimer.h
    inc/MantidKernel/Cache.h
    inc/MantidKernel/CaseInsensitiveMap.h
    inc/MantidKernel/CatalogInfo.h
    inc/MantidKernel/Chainable.h
    inc/MantidKernel/ChainableFactory.h
    inc/MantidKernel/ChecksumHelper.h
    inc/MantidKernel/CompositeValidator.h
    inc/MantidKernel/ComputeResourceInfo.h
    inc/MantidKernel/ConfigObserver.h
    inc/MantidKernel/ConfigPropertyObserver.h
Moore's avatar
Moore committed
168
    inc/MantidKernel/ConfigService.h
169
170
    inc/MantidKernel/DataItem.h
    inc/MantidKernel/DataService.h
Moore's avatar
Moore committed
171
    inc/MantidKernel/DateAndTime.h
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
    inc/MantidKernel/DateAndTimeHelpers.h
    inc/MantidKernel/DateTimeValidator.h
    inc/MantidKernel/DateValidator.h
    inc/MantidKernel/DeltaEMode.h
    inc/MantidKernel/Diffraction.h
    inc/MantidKernel/DirectoryValidator.h
    inc/MantidKernel/DiskBuffer.h
    inc/MantidKernel/DllConfig.h
    inc/MantidKernel/DllOpen.h
    inc/MantidKernel/DocumentationHeader.h
    inc/MantidKernel/DynamicFactory.h
    inc/MantidKernel/EigenConversionHelpers.h
    inc/MantidKernel/EmptyValues.h
    inc/MantidKernel/EnabledWhenProperty.h
    inc/MantidKernel/EnvironmentHistory.h
    inc/MantidKernel/EqualBinsChecker.h
Moore's avatar
Moore committed
188
    inc/MantidKernel/ErrorReporter.h
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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
    inc/MantidKernel/Exception.h
    inc/MantidKernel/FacilityInfo.h
    inc/MantidKernel/Fast_Exponential.h
    inc/MantidKernel/FileDescriptor.h
    inc/MantidKernel/FileValidator.h
    inc/MantidKernel/FilteredTimeSeriesProperty.h
    inc/MantidKernel/FloatingPointComparison.h
    inc/MantidKernel/FreeBlock.h
    inc/MantidKernel/FunctionTask.h
    inc/MantidKernel/GitHubApiHelper.h
    inc/MantidKernel/Glob.h
    inc/MantidKernel/ICatalogInfo.h
    inc/MantidKernel/IPropertyManager.h
    inc/MantidKernel/IPropertySettings.h
    inc/MantidKernel/ISaveable.h
    inc/MantidKernel/ITimeSeriesProperty.h
    inc/MantidKernel/IValidator.h
    inc/MantidKernel/IndexSet.h
    inc/MantidKernel/Instantiator.h
    inc/MantidKernel/InstrumentInfo.h
    inc/MantidKernel/InternetHelper.h
    inc/MantidKernel/Interpolation.h
    inc/MantidKernel/InvisibleProperty.h
    inc/MantidKernel/LibraryManager.h
    inc/MantidKernel/LibraryWrapper.h
    inc/MantidKernel/ListValidator.h
    inc/MantidKernel/LiveListenerInfo.h
    inc/MantidKernel/LogFilter.h
    inc/MantidKernel/LogParser.h
    inc/MantidKernel/Logger.h
    inc/MantidKernel/MDAxisValidator.h
    inc/MantidKernel/MDUnit.h
    inc/MantidKernel/MRUList.h
    inc/MantidKernel/MagneticIon.h
    inc/MantidKernel/MandatoryValidator.h
    inc/MantidKernel/MantidVersion.h
    inc/MantidKernel/MaskedProperty.h
    inc/MantidKernel/Material.h
    inc/MantidKernel/MaterialBuilder.h
    inc/MantidKernel/MaterialXMLParser.h
    inc/MantidKernel/Math/ChebyshevPolyFit.h
    inc/MantidKernel/Math/Distributions/ChebyshevPolynomial.h
    inc/MantidKernel/Math/Distributions/ChebyshevSeries.h
    inc/MantidKernel/Math/Optimization/SLSQPMinimizer.h
    inc/MantidKernel/Matrix.h
    inc/MantidKernel/MatrixProperty.h
    inc/MantidKernel/Memory.h
    inc/MantidKernel/MersenneTwister.h
    inc/MantidKernel/MultiFileNameParser.h
    inc/MantidKernel/MultiFileValidator.h
    inc/MantidKernel/MultiThreaded.h
    inc/MantidKernel/NDPseudoRandomNumberGenerator.h
    inc/MantidKernel/NDRandomNumberGenerator.h
    inc/MantidKernel/NearestNeighbours.h
    inc/MantidKernel/NetworkProxy.h
    inc/MantidKernel/NeutronAtom.h
    inc/MantidKernel/NexusDescriptor.h
246
    inc/MantidKernel/NexusHDF5Descriptor.h
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
    inc/MantidKernel/NullValidator.h
    inc/MantidKernel/OptionalBool.h
    inc/MantidKernel/PhysicalConstants.h
    inc/MantidKernel/PocoVersion.h
    inc/MantidKernel/ProgressBase.h
    inc/MantidKernel/Property.h
    inc/MantidKernel/PropertyHelper.h
    inc/MantidKernel/PropertyHistory.h
    inc/MantidKernel/PropertyManager.h
    inc/MantidKernel/PropertyManagerDataService.h
    inc/MantidKernel/PropertyManagerOwner.h
    inc/MantidKernel/PropertyManagerProperty.h
    inc/MantidKernel/PropertyManager_fwd.h
    inc/MantidKernel/PropertyNexus.h
    inc/MantidKernel/PropertyWithValue.h
    inc/MantidKernel/PropertyWithValueJSON.h
    inc/MantidKernel/ProxyInfo.h
    inc/MantidKernel/PseudoRandomNumberGenerator.h
    inc/MantidKernel/QuasiRandomNumberSequence.h
    inc/MantidKernel/Quat.h
    inc/MantidKernel/ReadLock.h
    inc/MantidKernel/RebinParamsValidator.h
    inc/MantidKernel/RegexStrings.h
    inc/MantidKernel/RegistrationHelper.h
    inc/MantidKernel/RemoteJobManager.h
Moore's avatar
Moore committed
272
    inc/MantidKernel/SimpleJSON.h
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
    inc/MantidKernel/SingletonHolder.h
    inc/MantidKernel/SobolSequence.h
    inc/MantidKernel/SpecialCoordinateSystem.h
    inc/MantidKernel/StartsWithValidator.h
    inc/MantidKernel/Statistics.h
    inc/MantidKernel/StdoutChannel.h
    inc/MantidKernel/StringContainsValidator.h
    inc/MantidKernel/StringTokenizer.h
    inc/MantidKernel/Strings.h
    inc/MantidKernel/System.h
    inc/MantidKernel/Task.h
    inc/MantidKernel/TestChannel.h
    inc/MantidKernel/ThreadPool.h
    inc/MantidKernel/ThreadPoolRunnable.h
    inc/MantidKernel/ThreadSafeLogStream.h
    inc/MantidKernel/ThreadScheduler.h
    inc/MantidKernel/ThreadSchedulerMutexes.h
    inc/MantidKernel/TimeSeriesProperty.h
    inc/MantidKernel/TimeSplitter.h
    inc/MantidKernel/Timer.h
    inc/MantidKernel/Tolerance.h
Moore's avatar
Moore committed
294
    inc/MantidKernel/TopicInfo.h
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
    inc/MantidKernel/TypedValidator.h
    inc/MantidKernel/Unit.h
    inc/MantidKernel/UnitConversion.h
    inc/MantidKernel/UnitFactory.h
    inc/MantidKernel/UnitLabel.h
    inc/MantidKernel/UnitLabelTypes.h
    inc/MantidKernel/UsageService.h
    inc/MantidKernel/UserCatalogInfo.h
    inc/MantidKernel/UserStringParser.h
    inc/MantidKernel/Utils.h
    inc/MantidKernel/V2D.h
    inc/MantidKernel/V3D.h
    inc/MantidKernel/VMD.h
    inc/MantidKernel/VectorHelper.h
    inc/MantidKernel/VisibleWhenProperty.h
    inc/MantidKernel/WarningSuppressions.h
    inc/MantidKernel/WriteLock.h
    inc/MantidKernel/cow_ptr.h
Moore's avatar
Moore committed
313
314
    inc/MantidKernel/make_cow.h
    inc/MantidKernel/normal_distribution.h)
315

316
317
318
319
320
321
set(TEST_FILES
    ArrayBoundedValidatorTest.h
    ArrayLengthValidatorTest.h
    ArrayOrderedPairsValidatorTest.h
    ArrayPropertyTest.h
    AtomTest.h
322
    AttenuationProfileTest.h
323
324
325
    BinFinderTest.h
    BinaryFileTest.h
    BinaryStreamReaderTest.h
326
    BinaryStreamWriterTest.h
327
328
329
330
331
332
333
334
335
336
337
338
    BoundedValidatorTest.h
    CPUTimerTest.h
    CacheTest.h
    CatalogInfoTest.h
    ChebyshevPolyFitTest.h
    ChebyshevPolynomialTest.h
    ChebyshevSeriesTest.h
    ChecksumHelperTest.h
    CompositeValidatorTest.h
    ComputeResourceInfoTest.h
    ConfigObserverTest.h
    ConfigPropertyObserverTest.h
Moore's avatar
Moore committed
339
    ConfigServiceTest.h
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
    CowPtrTest.h
    DataServiceTest.h
    DateAndTimeHelpersTest.h
    DateTimeValidatorTest.h
    DateValidatorTest.h
    DeltaEModeTest.h
    DiffractionTest.h
    DirectoryValidatorTest.h
    DiskBufferISaveableTest.h
    DiskBufferTest.h
    DllOpenTest.h
    DynamicFactoryTest.h
    EigenConversionHelpersTest.h
    EnabledWhenPropertyTest.h
    EnvironmentHistoryTest.h
    EqualBinsCheckerTest.h
Moore's avatar
Moore committed
356
    ErrorReporterTest.h
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
    FacilitiesTest.h
    FileDescriptorTest.h
    FileValidatorTest.h
    FilteredTimeSeriesPropertyTest.h
    FloatingPointComparisonTest.h
    FreeBlockTest.h
    FunctionTaskTest.h
    GlobTest.h
    IPropertySettingsTest.h
    ISaveableTest.h
    IValidatorTest.h
    IndexSetTest.h
    InstrumentInfoTest.h
    InternetHelperTest.h
    InterpolationTest.h
    InvisiblePropertyTest.h
    ListValidatorTest.h
    LiveListenerInfoTest.h
    LogFilterTest.h
    LogParserTest.h
    LoggerTest.h
    MDAxisValidatorTest.h
    MDUnitFactoryTest.h
    MDUnitTest.h
    MRUListTest.h
    MagneticIonTest.h
    MakeCowTest.h
    MandatoryValidatorTest.h
    MaskedPropertyTest.h
    MaterialBuilderTest.h
    MaterialTest.h
    MaterialXMLParserTest.h
    MatrixPropertyTest.h
    MatrixTest.h
    MemoryTest.h
    MersenneTwisterTest.h
    MultiFileNameParserTest.h
    MultiFileValidatorTest.h
    MutexTest.h
    NDPseudoRandomNumberGeneratorTest.h
    NDRandomNumberGeneratorTest.h
    NearestNeighboursTest.h
    NeutronAtomTest.h
    NexusDescriptorTest.h
401
    NexusHDF5DescriptorTest.h
402
403
404
405
406
407
408
409
410
411
    NullValidatorTest.h
    OptionalBoolTest.h
    ProgressBaseTest.h
    PropertyHistoryTest.h
    PropertyManagerDataServiceTest.h
    PropertyManagerPropertyTest.h
    PropertyManagerTest.h
    PropertyNexusTest.h
    PropertyTest.h
    PropertyWithValueJSONTest.h
Moore's avatar
Moore committed
412
    PropertyWithValueTest.h
413
414
415
416
417
418
419
420
    ProxyInfoTest.h
    QuatTest.h
    ReadLockTest.h
    RebinHistogramTest.h
    RebinParamsValidatorTest.h
    RegexStringsTest.h
    SLSQPMinimizerTest.h
    ShrinkToFitTest.h
421
    SimpleJSONTest.h
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
    SobolSequenceTest.h
    SpecialCoordinateSystemTest.h
    StartsWithValidatorTest.h
    StatisticsTest.h
    StdoutChannelTest.h
    StringContainsValidatorTest.h
    StringTokenizerTest.h
    StringsTest.h
    TaskTest.h
    ThreadPoolRunnableTest.h
    ThreadPoolTest.h
    ThreadSchedulerMutexesTest.h
    ThreadSchedulerTest.h
    TimeSeriesPropertyTest.h
    TimeSplitterTest.h
    TimerTest.h
Moore's avatar
Moore committed
438
    TopicInfoTest.h
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
    TypedValidatorTest.h
    UnitConversionTest.h
    UnitFactoryTest.h
    UnitLabelTest.h
    UnitTest.h
    UsageServiceTest.h
    UserCatalogInfoTest.h
    UserStringParserTest.h
    UtilsTest.h
    V2DTest.h
    V3DTest.h
    VMDTest.h
    VectorHelperTest.h
    VisibleWhenPropertyTest.h
    WriteLockTest.h)
454

455
456
457
458
459
460
if(COVERALLS)
  foreach(loop_var ${SRC_FILES} ${INC_FILES})
    set_property(GLOBAL APPEND
                 PROPERTY COVERAGE_SRCS
                          "${CMAKE_CURRENT_SOURCE_DIR}/${loop_var}")
  endforeach(loop_var)
Hahn, Steven's avatar
Hahn, Steven committed
461
462
endif()

463
464
465
466
467
468
469
470
471
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
  list(APPEND SRC_FILES src/NetworkProxyOSX.cpp)
  set(NETWORK_LIBRARIES
      "-framework SystemConfiguration"
      "-framework CoreFoundation"
      "-framework CoreServices")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
  list(APPEND SRC_FILES src/NetworkProxyWin.cpp)
  set(NETWORK_LIBRARIES Winhttp)
472
else()
473
  list(APPEND SRC_FILES src/NetworkProxyLinux.cpp)
474
475
endif()

476
477
if(UNITY_BUILD)
  include(UnityBuild)
478
  enable_unity_build(Kernel SRC_FILES SRC_UNITY_IGNORE_FILES 10)
479
480
endif(UNITY_BUILD)

481
482
483
# Enable precompiled headers where supported (must be done before target is
# added)
enable_precompiled_headers(inc/MantidKernel/PrecompiledHeader.h SRC_FILES)
484
# Add the target for this directory
485
add_library(Kernel ${SRC_FILES} ${INC_FILES})
486
# Set the name of the generated library
487
488
489
490
491
set_target_properties(Kernel
                      PROPERTIES OUTPUT_NAME
                                 MantidKernel
                                 COMPILE_DEFINITIONS
                                 "IN_MANTID_KERNEL;PSAPI_VERSION=1")
492

493
494
target_include_directories(Kernel SYSTEM
                           PUBLIC ${Boost_INCLUDE_DIRS} ${POCO_INCLUDE_DIRS}
495
496
                                  ${JSONCPP_INCLUDE_DIR} ${NEXUS_INCLUDE_DIR}
                           PRIVATE ${GSL_INCLUDE_DIR}
497
			   ${OPENSSL_INCLUDE_DIR} ${HDF5_INCLUDE_DIRS})
Hahn, Steven's avatar
Hahn, Steven committed
498

499
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
500
  set_target_properties(Kernel PROPERTIES INSTALL_RPATH "@loader_path/../MacOS;@loader_path/../Frameworks")
501
502
503
504
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
  set_target_properties(Kernel
                        PROPERTIES INSTALL_RPATH "\$ORIGIN/../${LIB_DIR}")
endif()
505

506
# Add to the 'Framework' group in VS
507
set_property(TARGET Kernel PROPERTY FOLDER "MantidFramework")
508

509
target_link_libraries(Kernel
510
                      PUBLIC
511
512
513
514
515
                      ${NEXUS_LIBRARIES}
                      Eigen3::Eigen
                      ${JSONCPP_LIBRARIES}
                      ${TBB_LIBRARIES}
                      ${TBB_MALLOC_LIBRARIES}
516
                      PRIVATE
517
518
                      ${GSL_LIBRARIES}
                      ${MANTIDLIBS}
519
520
                      ${NETWORK_LIBRARIES}
                      span
521
                      ${HDF5_LIBRARIES}
522
                      )
523
524
525
if(WIN32)
  target_link_libraries(Kernel LINK_PRIVATE Psapi.lib) # For memory usage
                                                       # queries
526
endif()
527

528
# Add the unit tests directory
529
add_subdirectory(test)
530

531
532
# This section deals with creating the MantidVersion implementation

533
# DON'T try to update the MantidVersion source file if we were not able to
534
535
# determine it from git and the file already exists. This makes sure the version
# number is correct when building off the source tarball
536

537
538
539
540
541
if(NOT NOT_GIT_REPO
   OR NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/MantidVersion.cpp)
  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/MantidVersion.cpp.in
                 ${CMAKE_CURRENT_SOURCE_DIR}/src/MantidVersion.cpp)
endif()
542

543
# This section deals with creating the PocoVersion implementation
544
545
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/inc/MantidKernel/PocoVersion.h.in
               ${CMAKE_CURRENT_SOURCE_DIR}/inc/MantidKernel/PocoVersion.h)
546

547
548
# This section deals with creating the GithubApiHelper implementation

549
550
551
552
if(WIN32)
  set(GITHUB_AUTHORIZATION_TOKEN "8ec7afc857540ee60af78cba1cf7779a6ed0b6b9")
elseif(APPLE)
  set(GITHUB_AUTHORIZATION_TOKEN "9f1c1acd61ecb87b21ad0382f6b403c8294992c5")
553
else()
554
  set(GITHUB_AUTHORIZATION_TOKEN "ccacbaf39a7ad8151fca03b4ea99a29b28f0993b")
555
endif()
556
557
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/inc/MantidKernel/GitHubApiHelper.h.in
               ${CMAKE_CURRENT_SOURCE_DIR}/inc/MantidKernel/GitHubApiHelper.h)
558

559
560
# Manipulate the Mantid.properties file to work wherever you build to

561
562
563
# This needs to be done as a 2-step process for it to work for VS builds First
# the part that turns relative into absolute paths in the properties file
set(MANTID_ROOT ${CMAKE_SOURCE_DIR})
564
# This keeps things working for people building just the framework project
565
566
567
if(${CMAKE_PROJECT_NAME} STREQUAL "MantidFramework")
  set(MANTID_ROOT ${CMAKE_SOURCE_DIR}/..)
endif()
568

569
570
set(FRAMEWORK_PLUGINS_DIR ".")
set(QT_PLUGINS_DIR ".")
571
# %V will be replaced with the major version of Qt at runtime
Peterson, Peter's avatar
Peterson, Peter committed
572
573
set(PV_PLUGINS_DIR "")
set(PARAVIEW_PYTHON_PATHS "")
574
575
576
577
578
set(IGNORE_PARAVIEW "0")
set(UPDATE_INSTRUMENT_DEFINTITIONS "0")
set(CHECK_FOR_NEW_MANTID_VERSION "0")
set(ENABLE_USAGE_REPORTS "0")
set(PYTHONPLUGIN_DIRS "${MANTID_ROOT}/Framework/PythonInterface/plugins")
579
set(PYTHONPLUGIN_MANIFEST "${CMAKE_BINARY_DIR}/Framework/PythonInterface/plugins/python-plugin-manifest.txt")
580
581
582
583
584
set(
  DATADIRS
  ${ExternalData_BINARY_ROOT}/Testing/Data/UnitTest;${ExternalData_BINARY_ROOT}/Testing/Data/DocTest;${MANTID_ROOT}/instrument
  )
set(COLORMAPS_FOLDER ${MANTID_ROOT}/installers/colormaps/)
585
set(MANTIDPUBLISHER "https://upload.mantidproject.org/scriptrepository?debug=1")
586
set(HTML_ROOT ${DOCS_BUILDDIR}/html)
587

588
589
590
591
592
593
594
595
596
597
# For an mpi-enabled build, do not log to file, format console output (which
# winds up in a file) differently These settings carry down to the installation
# configuration below
if(MPI_BUILD)
  set(CONSOLEPATTERN "%H:%M:%S,%i [%N:%P] %p %s - %t")
  set(PV_PLUGINS_DIR "")
  set(IGNORE_PARAVIEW "1")
else()
  set(CONSOLEPATTERN "%s-[%p] %t")
endif()
598

599
600
601
set(CONSOLECHANNELCLASS "ConsoleChannel")
configure_file(../Properties/Mantid.properties.template
               ${CMAKE_CURRENT_BINARY_DIR}/Mantid.properties.config)
602

603
# Then, copy into appropriate place
Hahn, Steven's avatar
Hahn, Steven committed
604
605
if(MSVC)
  file(GENERATE
606
607
608
609
       OUTPUT
       ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$<CONFIG>/Mantid.properties
       INPUT
       ${CMAKE_CURRENT_BINARY_DIR}/Mantid.properties.config)
Hahn, Steven's avatar
Hahn, Steven committed
610
611
else()
  file(GENERATE
612
613
614
615
       OUTPUT
       ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/Mantid.properties
       INPUT
       ${CMAKE_CURRENT_BINARY_DIR}/Mantid.properties.config)
Hahn, Steven's avatar
Hahn, Steven committed
616
endif()
617

618
# Installation settings
619

620
mtd_install_targets(TARGETS Kernel INSTALL_DIRS ${LIB_DIR} ${WORKBENCH_LIB_DIR})
621
622

# Create the properties file for the installer
623
set(MANTID_ROOT_BUILD ${MANTID_ROOT})
624
set(MANTID_ROOT ..)
625

626
# Log to file for installed packages but not mpi
627
628
629
630
631
632
633
if(MPI_BUILD OR MPI_EXPERIMENTAL)
  set(ENABLE_NETWORK_ACCESS 0)
else()
  set(ENABLE_NETWORK_ACCESS 1)
endif()
set(FRAMEWORK_PLUGINS_DIR ${MANTID_ROOT}/plugins)
set(PYTHONPLUGIN_DIRS "${FRAMEWORK_PLUGINS_DIR}/python")
634
set(PYTHONPLUGIN_MANIFEST "${PYTHONPLUGIN_DIRS}/python-plugin-manifest.txt")
Peterson, Peter's avatar
Peterson, Peter committed
635
set(PARAVIEW_PYTHON_PATHS "")
636
637
638
639
set(UPDATE_INSTRUMENT_DEFINTITIONS "${ENABLE_NETWORK_ACCESS}")
set(CHECK_FOR_NEW_MANTID_VERSION "${ENABLE_NETWORK_ACCESS}")
set(ENABLE_USAGE_REPORTS "${ENABLE_NETWORK_ACCESS}")
set(DATADIRS "")
640
set(MANTIDPUBLISHER "https://upload.mantidproject.org/scriptrepository")
641
set(HTML_ROOT ../share/doc/html)
642

643
644
645
646
647
648
649
650
651
652
653
654
# For a framework-only (e.g. MPI) build some of these are not relevant and
# should be left empty to avoid warnings on starting Mantid
if(${CMAKE_PROJECT_NAME} MATCHES "MantidFramework")
  set(QT_PLUGINS_DIR "")
  set(COLORMAPS_FOLDER "")
  set(PV_PLUGINS_DIR "")
  set(IGNORE_PARAVIEW "1")
else()
  set(QT_PLUGINS_DIR "${MANTID_ROOT}/plugins/qt%V")
  set(PV_PLUGINS_DIR "${MANTID_ROOT}/plugins/${PVPLUGINS_SUBDIR}/qt%V")
  set(COLORMAPS_FOLDER ${MANTID_ROOT}/colormaps)
endif()
655

656
657
658
659
660
661
set(CONSOLECHANNELCLASS "StdoutChannel")
configure_file(../Properties/Mantid.properties.template
               ${CMAKE_CURRENT_BINARY_DIR}/Mantid.properties.install)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Mantid.properties.install
        DESTINATION ${BIN_DIR}
        RENAME Mantid.properties)
Samuel Jackson's avatar
Samuel Jackson committed
662

663
664
665
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Mantid.properties.install
        DESTINATION ${WORKBENCH_BIN_DIR}
        RENAME Mantid.properties)