CMakeLists.txt 22.3 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
100
    src/NullValidator.cpp
    src/OptionalBool.cpp
    src/ParaViewVersion.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
101
    src/SimpleJSON.cpp
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
    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
117
    src/TopicInfo.cpp
118
119
120
121
122
123
124
125
126
127
128
129
130
131
    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)
132

133
134
135
136
137
138
139
140
141
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)
142

143
144
145
146
147
148
149
150
151
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
152
    inc/MantidKernel/AttenuationProfile.h
153
154
155
    inc/MantidKernel/BinFinder.h
    inc/MantidKernel/BinaryFile.h
    inc/MantidKernel/BinaryStreamReader.h
156
    inc/MantidKernel/BinaryStreamWriter.h
157
158
159
160
161
162
163
164
165
166
167
168
    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
169
    inc/MantidKernel/ConfigService.h
170
171
    inc/MantidKernel/DataItem.h
    inc/MantidKernel/DataService.h
Moore's avatar
Moore committed
172
    inc/MantidKernel/DateAndTime.h
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
    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
189
    inc/MantidKernel/ErrorReporter.h
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
246
    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
247
    inc/MantidKernel/NexusHDF5Descriptor.h
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
    inc/MantidKernel/NullValidator.h
    inc/MantidKernel/OptionalBool.h
    inc/MantidKernel/ParaViewVersion.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
274
    inc/MantidKernel/SimpleJSON.h
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
    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
296
    inc/MantidKernel/TopicInfo.h
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
    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
315
316
    inc/MantidKernel/make_cow.h
    inc/MantidKernel/normal_distribution.h)
317

318
319
320
321
322
323
set(TEST_FILES
    ArrayBoundedValidatorTest.h
    ArrayLengthValidatorTest.h
    ArrayOrderedPairsValidatorTest.h
    ArrayPropertyTest.h
    AtomTest.h
324
    AttenuationProfileTest.h
325
326
327
    BinFinderTest.h
    BinaryFileTest.h
    BinaryStreamReaderTest.h
328
    BinaryStreamWriterTest.h
329
330
331
332
333
334
335
336
337
338
339
340
    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
341
    ConfigServiceTest.h
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
    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
358
    ErrorReporterTest.h
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
401
402
    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
403
    NexusHDF5DescriptorTest.h
404
405
406
407
408
409
410
411
412
413
    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
414
    PropertyWithValueTest.h
415
416
417
418
419
420
421
422
    ProxyInfoTest.h
    QuatTest.h
    ReadLockTest.h
    RebinHistogramTest.h
    RebinParamsValidatorTest.h
    RegexStringsTest.h
    SLSQPMinimizerTest.h
    ShrinkToFitTest.h
423
    SimpleJSONTest.h
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
    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
440
    TopicInfoTest.h
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
    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)
456

457
458
459
460
461
462
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
463
464
endif()

465
466
467
468
469
470
471
472
473
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)
474
else()
475
  list(APPEND SRC_FILES src/NetworkProxyLinux.cpp)
476
477
endif()

478
479
if(UNITY_BUILD)
  include(UnityBuild)
480
  enable_unity_build(Kernel SRC_FILES SRC_UNITY_IGNORE_FILES 10)
481
482
endif(UNITY_BUILD)

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

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

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

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

511
512
513
514
# For older gcc versions (<4.5) if we do not put stdc++ first then things crash
# when an exceptions are thrown in Python.
if(GCC_COMPILER_VERSION AND GCC_COMPILER_VERSION VERSION_LESS "4.5")
  target_link_libraries(Kernel LINK_PRIVATE stdc++)
515
endif()
516
target_link_libraries(Kernel
517
                      PUBLIC
518
519
520
521
522
                      ${NEXUS_LIBRARIES}
                      Eigen3::Eigen
                      ${JSONCPP_LIBRARIES}
                      ${TBB_LIBRARIES}
                      ${TBB_MALLOC_LIBRARIES}
523
                      PRIVATE
524
525
526
                      ${TCMALLOC_LIBRARIES_LINKTIME}
                      ${GSL_LIBRARIES}
                      ${MANTIDLIBS}
527
528
                      ${NETWORK_LIBRARIES}
                      span
529
                      ${HDF5_LIBRARIES}
530
                      )
531
532
533
if(WIN32)
  target_link_libraries(Kernel LINK_PRIVATE Psapi.lib) # For memory usage
                                                       # queries
534
endif()
535

536
# Add the unit tests directory
537
add_subdirectory(test)
538

539
540
# This section deals with creating the MantidVersion implementation

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

545
546
547
548
549
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()
550

551
# This section deals with creating the PocoVersion implementation
552
553
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/inc/MantidKernel/PocoVersion.h.in
               ${CMAKE_CURRENT_SOURCE_DIR}/inc/MantidKernel/PocoVersion.h)
554

555
# This section deals with creating the ParaViewVersion implementation
556
557
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/ParaViewVersion.cpp.in
               ${CMAKE_CURRENT_SOURCE_DIR}/src/ParaViewVersion.cpp)
558
559
# This section deals with creating the GithubApiHelper implementation

560
561
562
563
if(WIN32)
  set(GITHUB_AUTHORIZATION_TOKEN "8ec7afc857540ee60af78cba1cf7779a6ed0b6b9")
elseif(APPLE)
  set(GITHUB_AUTHORIZATION_TOKEN "9f1c1acd61ecb87b21ad0382f6b403c8294992c5")
564
else()
565
  set(GITHUB_AUTHORIZATION_TOKEN "ccacbaf39a7ad8151fca03b4ea99a29b28f0993b")
566
endif()
567
568
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/inc/MantidKernel/GitHubApiHelper.h.in
               ${CMAKE_CURRENT_SOURCE_DIR}/inc/MantidKernel/GitHubApiHelper.h)
569

570
571
# Manipulate the Mantid.properties file to work wherever you build to

572
573
574
# 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})
575
# This keeps things working for people building just the framework project
576
577
578
if(${CMAKE_PROJECT_NAME} STREQUAL "MantidFramework")
  set(MANTID_ROOT ${CMAKE_SOURCE_DIR}/..)
endif()
579

580
581
set(FRAMEWORK_PLUGINS_DIR ".")
set(QT_PLUGINS_DIR ".")
582
# %V will be replaced with the major version of Qt at runtime
583
584
585
586
587
588
589
if(MAKE_VATES)
  set(PV_PLUGINS_DIR "./plugins/paraview/qt%V")
  if(MSVC)
    set(
      PARAVIEW_PYTHON_PATHS
      "${ParaView_DIR}/bin/$<$<CONFIG:Release>:Release>$<$<CONFIG:Debug>:Debug>;${ParaView_DIR}/lib/$<$<CONFIG:Release>:Release>$<$<CONFIG:Debug>:Debug>;${ParaView_DIR}/lib/site-packages;"
      )
590
  else()
591
592
    set(PARAVIEW_PYTHON_PATHS
        "${ParaView_DIR}/lib;${ParaView_DIR}/lib/site-packages;")
593
  endif()
594
595
596
597
598
599
600
601
602
603
604
605
606
607
else()
  set(PV_PLUGINS_DIR "")
  set(PARAVIEW_PYTHON_PATHS "")
endif()
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")
set(
  DATADIRS
  ${ExternalData_BINARY_ROOT}/Testing/Data/UnitTest;${ExternalData_BINARY_ROOT}/Testing/Data/DocTest;${MANTID_ROOT}/instrument
  )
set(COLORMAPS_FOLDER ${MANTID_ROOT}/installers/colormaps/)
608
set(MANTIDPUBLISHER "https://upload.mantidproject.org/scriptrepository?debug=1")
609
set(HTML_ROOT ${DOCS_BUILDDIR}/html)
610

611
612
613
614
615
616
617
618
619
620
# 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()
621

622
623
624
set(CONSOLECHANNELCLASS "ConsoleChannel")
configure_file(../Properties/Mantid.properties.template
               ${CMAKE_CURRENT_BINARY_DIR}/Mantid.properties.config)
625

626
# Then, copy into appropriate place
Hahn, Steven's avatar
Hahn, Steven committed
627
628
if(MSVC)
  file(GENERATE
629
630
631
632
       OUTPUT
       ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$<CONFIG>/Mantid.properties
       INPUT
       ${CMAKE_CURRENT_BINARY_DIR}/Mantid.properties.config)
Hahn, Steven's avatar
Hahn, Steven committed
633
634
else()
  file(GENERATE
635
636
637
638
       OUTPUT
       ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/Mantid.properties
       INPUT
       ${CMAKE_CURRENT_BINARY_DIR}/Mantid.properties.config)
Hahn, Steven's avatar
Hahn, Steven committed
639
endif()
640

641
# Installation settings
642

643
mtd_install_targets(TARGETS Kernel INSTALL_DIRS ${LIB_DIR} ${WORKBENCH_LIB_DIR})
644
645

# Create the properties file for the installer
646
set(MANTID_ROOT_BUILD ${MANTID_ROOT})
647
set(MANTID_ROOT ..)
648

649
# Log to file for installed packages but not mpi
650
651
652
653
654
655
656
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")
657
if(MAKE_VATES)
658
659
660
661
662
663
664
665
666
667
668
669
  if(APPLE)
    set(PARAVIEW_PYTHON_PATHS "../Libraries;../Python;")
  elseif(WIN32)
    set(PV_LIBS
        "../lib/paraview-${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}")
    set(PARAVIEW_PYTHON_PATHS "${PV_LIBS}/site-packages;")
  else() # Linux
    set(PV_LIBS "${CMAKE_INSTALL_PREFIX}/lib/paraview-${PARAVIEW_VERSION}")
    set(PARAVIEW_PYTHON_PATHS "${PV_LIBS};${PV_LIBS}/site-packages;")
  endif()
else()
  set(PARAVIEW_PYTHON_PATHS "")
670
endif()
671
672
673
674
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 "")
675
set(MANTIDPUBLISHER "https://upload.mantidproject.org/scriptrepository")
676
set(HTML_ROOT ../share/doc/html)
677

678
679
680
681
682
683
684
685
686
687
688
689
# 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()
690

691
692
693
694
695
696
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
697

698
699
700
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Mantid.properties.install
        DESTINATION ${WORKBENCH_BIN_DIR}
        RENAME Mantid.properties)