CMakeLists.txt 22.1 KB
Newer Older
1
2
3
4
5
6
7
8
9
set(SRC_FILES
    src/ANN_complete.cpp
    src/ArrayBoundedValidator.cpp
    src/ArrayLengthValidator.cpp
    src/ArrayOrderedPairsValidator.cpp
    src/ArrayProperty.cpp
    src/Atom.cpp
    src/BinFinder.cpp
    src/BinaryStreamReader.cpp
10
    src/BinaryStreamWriter.cpp
11
12
13
14
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
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
    src/CPUTimer.cpp
    src/CatalogInfo.cpp
    src/ChecksumHelper.cpp
    src/CompositeValidator.cpp
    src/ComputeResourceInfo.cpp
    src/ConfigService.cpp
    src/ConfigObserver.cpp
    src/ConfigPropertyObserver.cpp
    src/DateAndTime.cpp
    src/DataItem.cpp
    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
    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
99
    src/SimpleJSON.cpp
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
    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
    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)
129

130
131
132
133
134
135
136
137
138
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)
139

140
141
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
    inc/MantidKernel/BinFinder.h
    inc/MantidKernel/BinaryFile.h
    inc/MantidKernel/BinaryStreamReader.h
152
    inc/MantidKernel/BinaryStreamWriter.h
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
184
185
186
187
188
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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
    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/ConfigService.h
    inc/MantidKernel/ConfigObserver.h
    inc/MantidKernel/ConfigPropertyObserver.h
    inc/MantidKernel/DateAndTime.h
    inc/MantidKernel/DataItem.h
    inc/MantidKernel/DataService.h
    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/ErrorReporter.h
    inc/MantidKernel/EqualBinsChecker.h
    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
    inc/MantidKernel/normal_distribution.h
    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
270
    inc/MantidKernel/SimpleJSON.h
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
    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
    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/XMLInstantiator.h
    inc/MantidKernel/cow_ptr.h
311
    inc/MantidKernel/make_cow.h)
312

313
314
315
316
317
318
319
320
321
set(TEST_FILES
    ArrayBoundedValidatorTest.h
    ArrayLengthValidatorTest.h
    ArrayOrderedPairsValidatorTest.h
    ArrayPropertyTest.h
    AtomTest.h
    BinFinderTest.h
    BinaryFileTest.h
    BinaryStreamReaderTest.h
322
    BinaryStreamWriterTest.h
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
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
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
    BoundedValidatorTest.h
    CPUTimerTest.h
    CacheTest.h
    CatalogInfoTest.h
    ChebyshevPolyFitTest.h
    ChebyshevPolynomialTest.h
    ChebyshevSeriesTest.h
    ChecksumHelperTest.h
    CompositeValidatorTest.h
    ComputeResourceInfoTest.h
    ConfigServiceTest.h
    ConfigObserverTest.h
    ConfigPropertyObserverTest.h
    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
    ErrorReporterTest.h
    EqualBinsCheckerTest.h
    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
    NullValidatorTest.h
    OptionalBoolTest.h
    ProgressBaseTest.h
    PropertyHistoryTest.h
    PropertyManagerDataServiceTest.h
    PropertyManagerPropertyTest.h
    PropertyManagerTest.h
    PropertyNexusTest.h
    PropertyTest.h
    PropertyWithValueTest.h
    PropertyWithValueJSONTest.h
    ProxyInfoTest.h
    QuatTest.h
    ReadLockTest.h
    RebinHistogramTest.h
    RebinParamsValidatorTest.h
    RegexStringsTest.h
    SLSQPMinimizerTest.h
    ShrinkToFitTest.h
416
    SimpleJSONTest.h
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
    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
    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)
448

449
450
451
452
453
454
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
455
456
endif()

457
458
459
460
461
462
463
464
465
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)
466
else()
467
  list(APPEND SRC_FILES src/NetworkProxyLinux.cpp)
468
469
endif()

470
471
if(UNITY_BUILD)
  include(UnityBuild)
472
  enable_unity_build(Kernel SRC_FILES SRC_UNITY_IGNORE_FILES 10)
473
474
endif(UNITY_BUILD)

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

487
488
489
490
target_include_directories(Kernel SYSTEM
                           PUBLIC ${Boost_INCLUDE_DIRS} ${POCO_INCLUDE_DIRS}
                                  ${JSONCPP_INCLUDE_DIR}
                           PRIVATE ${NEXUS_INCLUDE_DIR} ${GSL_INCLUDE_DIR}
Hahn, Steven's avatar
Hahn, Steven committed
491
                                   ${OPENSSL_INCLUDE_DIR} ${SPAN_INCLUDE_DIR})
Hahn, Steven's avatar
Hahn, Steven committed
492

493
if(OSX_VERSION VERSION_GREATER 10.8)
494
  set_target_properties(Kernel PROPERTIES INSTALL_RPATH "@loader_path/../MacOS")
495
496
497
498
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
  set_target_properties(Kernel
                        PROPERTIES INSTALL_RPATH "\$ORIGIN/../${LIB_DIR}")
endif()
499

500
# Add to the 'Framework' group in VS
501
set_property(TARGET Kernel PROPERTY FOLDER "MantidFramework")
502

503
504
505
506
# 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++)
507
endif()
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
target_link_libraries(Kernel
                      LINK_PUBLIC
                      ${NEXUS_LIBRARIES}
                      Eigen3::Eigen
                      ${JSONCPP_LIBRARIES}
                      ${TBB_LIBRARIES}
                      ${TBB_MALLOC_LIBRARIES}
                      LINK_PRIVATE
                      ${TCMALLOC_LIBRARIES_LINKTIME}
                      ${GSL_LIBRARIES}
                      ${MANTIDLIBS}
                      ${NETWORK_LIBRARIES})
if(WIN32)
  target_link_libraries(Kernel LINK_PRIVATE Psapi.lib) # For memory usage
                                                       # queries
523
endif()
524

525
# Add the unit tests directory
526
add_subdirectory(test)
527

528
529
# This section deals with creating the MantidVersion implementation

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

534
535
536
537
538
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()
539

540
# This section deals with creating the PocoVersion implementation
541
542
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/inc/MantidKernel/PocoVersion.h.in
               ${CMAKE_CURRENT_SOURCE_DIR}/inc/MantidKernel/PocoVersion.h)
543

544
# This section deals with creating the ParaViewVersion implementation
545
546
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/ParaViewVersion.cpp.in
               ${CMAKE_CURRENT_SOURCE_DIR}/src/ParaViewVersion.cpp)
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
572
573
574
575
576
577
578
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;"
      )
579
  else()
580
581
    set(PARAVIEW_PYTHON_PATHS
        "${ParaView_DIR}/lib;${ParaView_DIR}/lib/site-packages;")
582
  endif()
583
584
585
586
587
588
589
590
591
592
593
594
595
596
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/)
597
set(MANTIDPUBLISHER "https://upload.mantidproject.org/scriptrepository")
598
set(HTML_ROOT ${DOCS_BUILDDIR}/html)
599

600
601
602
603
604
605
606
607
608
609
# 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()
610

611
612
613
set(CONSOLECHANNELCLASS "ConsoleChannel")
configure_file(../Properties/Mantid.properties.template
               ${CMAKE_CURRENT_BINARY_DIR}/Mantid.properties.config)
614

615
# Then, copy into appropriate place
Hahn, Steven's avatar
Hahn, Steven committed
616
617
if(MSVC)
  file(GENERATE
618
619
620
621
       OUTPUT
       ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$<CONFIG>/Mantid.properties
       INPUT
       ${CMAKE_CURRENT_BINARY_DIR}/Mantid.properties.config)
Hahn, Steven's avatar
Hahn, Steven committed
622
623
else()
  file(GENERATE
624
625
626
627
       OUTPUT
       ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/Mantid.properties
       INPUT
       ${CMAKE_CURRENT_BINARY_DIR}/Mantid.properties.config)
Hahn, Steven's avatar
Hahn, Steven committed
628
endif()
629

630
# Installation settings
631

632
mtd_install_targets(TARGETS Kernel INSTALL_DIRS ${LIB_DIR} ${WORKBENCH_LIB_DIR})
633
634

# Create the properties file for the installer
635
636
637
638
639
640
set(MANTID_ROOT_BUILD ${MANTID_ROOT})
if(APPLE AND ENABLE_MANTIDPLOT)
  set(MANTID_ROOT ../..)
else()
  set(MANTID_ROOT ..)
endif()
641

642
# Log to file for installed packages but not mpi
643
644
645
646
647
648
649
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")
650
if(MAKE_VATES)
651
652
653
654
655
656
657
658
659
660
661
662
  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 "")
663
endif()
664
665
666
667
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 "")
668
set(MANTIDPUBLISHER "https://upload.mantidproject.org/scriptrepository")
669
set(HTML_ROOT ../share/doc/html)
670

671
672
673
674
675
676
677
678
679
680
681
682
# 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()
683

684
685
686
687
688
689
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
690

691
692
693
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Mantid.properties.install
        DESTINATION ${WORKBENCH_BIN_DIR}
        RENAME Mantid.properties)