CMakeLists.txt 20.6 KB
Newer Older
1
set(SRC_FILES
2
    src/SetValueWhenProperty.cpp
3
4
5
6
7
8
    src/ANN_complete.cpp
    src/ArrayBoundedValidator.cpp
    src/ArrayLengthValidator.cpp
    src/ArrayOrderedPairsValidator.cpp
    src/ArrayProperty.cpp
    src/Atom.cpp
9
    src/AttenuationProfile.cpp
10
11
    src/BinFinder.cpp
    src/BinaryStreamReader.cpp
12
    src/BinaryStreamWriter.cpp
13
14
15
16
17
18
19
    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
20
    src/ConfigService.cpp
21
    src/DataItem.cpp
Moore's avatar
Moore committed
22
    src/DateAndTime.cpp
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/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
set(INC_FILES
143
    inc/MantidKernel/SetValueWhenProperty.h
144
145
146
147
148
149
150
151
    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
    inc/MantidKernel/DateAndTimeHelpers.h
    inc/MantidKernel/DateTimeValidator.h
    inc/MantidKernel/DateValidator.h
    inc/MantidKernel/DeltaEMode.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
    CowPtrTest.h
    DataServiceTest.h
    DateAndTimeHelpersTest.h
    DateTimeValidatorTest.h
    DateValidatorTest.h
    DeltaEModeTest.h
    DirectoryValidatorTest.h
    DiskBufferISaveableTest.h
    DiskBufferTest.h
    DllOpenTest.h
    DynamicFactoryTest.h
    EigenConversionHelpersTest.h
    EnabledWhenPropertyTest.h
    EnvironmentHistoryTest.h
    EqualBinsCheckerTest.h
Moore's avatar
Moore committed
355
    ErrorReporterTest.h
356
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
    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
400
    NexusHDF5DescriptorTest.h
401
402
403
404
405
406
407
408
409
410
    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
411
    PropertyWithValueTest.h
412
413
414
415
416
417
418
419
    ProxyInfoTest.h
    QuatTest.h
    ReadLockTest.h
    RebinHistogramTest.h
    RebinParamsValidatorTest.h
    RegexStringsTest.h
    SLSQPMinimizerTest.h
    ShrinkToFitTest.h
420
    SimpleJSONTest.h
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
    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
437
    TopicInfoTest.h
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
    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)
453

454
455
456
457
458
459
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
460
461
endif()

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

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

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

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

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

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

508
target_link_libraries(Kernel
509
                      PUBLIC
510
511
512
513
514
                      ${NEXUS_LIBRARIES}
                      Eigen3::Eigen
                      ${JSONCPP_LIBRARIES}
                      ${TBB_LIBRARIES}
                      ${TBB_MALLOC_LIBRARIES}
515
                      PRIVATE
516
517
                      ${GSL_LIBRARIES}
                      ${MANTIDLIBS}
518
519
                      ${NETWORK_LIBRARIES}
                      span
520
                      ${HDF5_LIBRARIES}
521
                      Json
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
# This section deals with creating the GithubApiHelper implementation
548
549
set (GITHUB_AUTHORIZATION_TOKEN ""
     CACHE STRING "token used for authenticated read access to github")
550
551
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/inc/MantidKernel/GitHubApiHelper.h.in
               ${CMAKE_CURRENT_SOURCE_DIR}/inc/MantidKernel/GitHubApiHelper.h)
552

553
554
# Manipulate the Mantid.properties file to work wherever you build to

555
556
557
# 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})
558
# This keeps things working for people building just the framework project
559
560
561
if(${CMAKE_PROJECT_NAME} STREQUAL "MantidFramework")
  set(MANTID_ROOT ${CMAKE_SOURCE_DIR}/..)
endif()
562

563
564
set(FRAMEWORK_PLUGINS_DIR ".")
set(QT_PLUGINS_DIR ".")
565
# %V will be replaced with the major version of Qt at runtime
Peterson, Peter's avatar
Peterson, Peter committed
566
set(PV_PLUGINS_DIR "")
567
568
569
570
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")
571
set(PYTHONPLUGIN_MANIFEST "${CMAKE_BINARY_DIR}/Framework/PythonInterface/plugins/python-plugin-manifest.txt")
572
573
574
575
576
set(
  DATADIRS
  ${ExternalData_BINARY_ROOT}/Testing/Data/UnitTest;${ExternalData_BINARY_ROOT}/Testing/Data/DocTest;${MANTID_ROOT}/instrument
  )
set(COLORMAPS_FOLDER ${MANTID_ROOT}/installers/colormaps/)
577
set(MANTIDPUBLISHER "https://upload.mantidproject.org/scriptrepository?debug=1")
578
set(HTML_ROOT ${DOCS_BUILDDIR}/html)
579

580
581
582
583
584
585
586
587
# 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")
else()
  set(CONSOLEPATTERN "%s-[%p] %t")
endif()
588

589
590
591
set(CONSOLECHANNELCLASS "ConsoleChannel")
configure_file(../Properties/Mantid.properties.template
               ${CMAKE_CURRENT_BINARY_DIR}/Mantid.properties.config)
592

593
# Then, copy into appropriate place
Hahn, Steven's avatar
Hahn, Steven committed
594
595
if(MSVC)
  file(GENERATE
596
597
598
599
       OUTPUT
       ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$<CONFIG>/Mantid.properties
       INPUT
       ${CMAKE_CURRENT_BINARY_DIR}/Mantid.properties.config)
Hahn, Steven's avatar
Hahn, Steven committed
600
601
else()
  file(GENERATE
602
603
604
605
       OUTPUT
       ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/Mantid.properties
       INPUT
       ${CMAKE_CURRENT_BINARY_DIR}/Mantid.properties.config)
Hahn, Steven's avatar
Hahn, Steven committed
606
endif()
607

608
# Installation settings
609

610
mtd_install_targets(TARGETS Kernel INSTALL_DIRS ${LIB_DIR} ${WORKBENCH_LIB_DIR})
611
612

# Create the properties file for the installer
613
set(MANTID_ROOT_BUILD ${MANTID_ROOT})
614
set(MANTID_ROOT ..)
615

616
# Log to file for installed packages but not mpi
617
618
619
620
621
622
623
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")
624
set(PYTHONPLUGIN_MANIFEST "${PYTHONPLUGIN_DIRS}/python-plugin-manifest.txt")
625
626
627
628
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 "")
629
set(MANTIDPUBLISHER "https://upload.mantidproject.org/scriptrepository")
630
set(HTML_ROOT ../share/doc/html)
631

632
633
634
635
636
637
638
639
640
# 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 "")
else()
  set(QT_PLUGINS_DIR "${MANTID_ROOT}/plugins/qt%V")
  set(COLORMAPS_FOLDER ${MANTID_ROOT}/colormaps)
endif()
641

642
643
644
set(CONSOLECHANNELCLASS "StdoutChannel")
configure_file(../Properties/Mantid.properties.template
               ${CMAKE_CURRENT_BINARY_DIR}/Mantid.properties.install)
Samuel Jackson's avatar
Samuel Jackson committed
645

646
647
648
649
mtd_install_files(FILES ${CMAKE_CURRENT_BINARY_DIR}/Mantid.properties.install
                  INSTALL_DIRS ${BIN_DIR} ${WORKBENCH_BIN_DIR}
                  RENAME Mantid.properties)