forked from mantidproject/mantid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
987 lines (909 loc) · 40.1 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
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
99
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
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
270
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
311
312
313
314
315
316
317
318
319
320
321
322
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
416
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
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
# NOTE that there are a lot of places in this CMakeLists where files need to
# be explicitly listed - we not only have to add the sources and headers,
# but also the files that need to be made known to Qt and sip.
###########################################################################
# Add the source files
###########################################################################
set ( QTIPLOT_SRCS src/ApplicationWindow.cpp
src/ArrowMarker.cpp
src/AssociationsDialog.cpp
src/AxesDialog.cpp
src/AxisDetails.cpp
src/Bar.cpp
src/BoxCurve.cpp
src/CanvasPicker.cpp
src/ColorMapDialog.cpp
src/Cone3D.cpp
src/ConfigDialog.cpp
src/ContourLinesEditor.cpp
src/Convolution.cpp
src/Correlation.cpp
src/CurveRangeDialog.cpp
src/CurvesDialog.cpp
src/CustomActionDialog.cpp
src/DataPickerTool.cpp
src/DataSetDialog.cpp
src/Differentiation.cpp
src/DockedWindow.cpp
src/ErrDialog.cpp
src/ExpDecayDialog.cpp
src/ExponentialFit.cpp
src/ExportDialog.cpp
src/FFT.cpp
src/FFTDialog.cpp
src/FFTFilter.cpp
src/Filter.cpp
src/FilterDialog.cpp
src/FindDialog.cpp
src/Fit.cpp
src/FitDialog.cpp
src/fit_gsl.cpp
src/FitModelHandler.cpp
src/FloatingWindow.cpp
src/Folder.cpp
src/FunctionCurve.cpp
src/FunctionDialog.cpp
src/globals.cpp
src/Graph3D.cpp
src/Graph.cpp
src/Grid.cpp
src/GridDetails.cpp
src/ImageDialog.cpp
src/ImageExportDialog.cpp
src/ImageMarker.cpp
src/ImportASCIIDialog.cpp
src/importOPJ.cpp
src/IntDialog.cpp
src/Integration.cpp
src/Interpolation.cpp
src/InterpolationDialog.cpp
src/LabelTool.cpp
src/LayerDialog.cpp
src/LegendWidget.cpp
src/LineDialog.cpp
src/LineProfileTool.cpp
src/LogisticFit.cpp
src/MatrixCommand.cpp
src/Matrix.cpp
src/MatrixDialog.cpp
src/MatrixModel.cpp
src/MatrixSizeDialog.cpp
src/MatrixValuesDialog.cpp
src/MdiSubWindow.cpp
src/MultiLayer.cpp
src/MultiPeakFit.cpp
src/MultiPeakFitTool.cpp
src/muParserScript.cpp
src/muParserScripting.cpp
src/MyParser.cpp
src/NonLinearFit.cpp
src/Note.cpp
src/nrutil.cpp
src/OpenProjectDialog.cpp
src/Plot3DDialog.cpp
src/Plot.cpp
src/PlotCurve.cpp
src/PlotDialog.cpp
src/PlotWizard.cpp
src/PluginFit.cpp
src/PolynomFitDialog.cpp
src/PolynomialFit.cpp
src/ProjectSaveView.cpp
src/ProjectSerialiser.cpp
src/PythonScript.cpp
src/PythonScripting.cpp
src/QwtBarCurve.cpp
src/QwtErrorPlotCurve.cpp
src/QwtHistogram.cpp
src/QwtPieCurve.cpp
src/RangeSelectorTool.cpp
src/RenameWindowDialog.cpp
src/ScaleDetails.cpp
src/ScaleDraw.cpp
src/ScalePicker.cpp
src/ScreenPickerTool.cpp
src/Script.cpp
src/ScriptCode.cpp
src/Scripted.cpp
src/ScriptingEnv.cpp
src/ScriptingLangDialog.cpp
src/ScriptingWindow.cpp
src/ScriptFileInterpreter.cpp
src/MultiTabScriptInterpreter.cpp
src/ScriptOutputDisplay.cpp
src/SelectionMoveResizer.cpp
src/SendToProgramDialog.cpp
src/SetColValuesDialog.cpp
src/SigmoidalFit.cpp
src/SmoothCurveDialog.cpp
src/SmoothFilter.cpp
src/SortDialog.cpp
src/Spectrogram.cpp
src/SurfaceDialog.cpp
src/Table.cpp
src/TableDialog.cpp
src/TableStatistics.cpp
src/TextDialog.cpp
src/TextEditor.cpp
src/TextFileIO.cpp
src/TiledWindow.cpp
src/TitlePicker.cpp
src/TranslateCurveTool.cpp
src/UserFunction.cpp
src/VectorCurve.cpp
src/WindowFactory.cpp
src/origin/OPJFile.cpp
src/plot2D/ImageSymbol.cpp
src/analysis/fft2D.cpp
src/lib/src/CollapsiveGroupBox.cpp
src/lib/src/ColorBox.cpp
src/lib/src/ColorButton.cpp
src/lib/src/ColorMapEditor.cpp
src/lib/src/ExtensibleFileDialog.cpp
src/lib/src/LineNumberDisplay.cpp
src/lib/src/PatternBox.cpp
src/lib/src/PenStyleBox.cpp
src/lib/src/SymbolBox.cpp
src/lib/src/SymbolDialog.cpp
src/lib/src/TextFormatButtons.cpp
src/lib/3rdparty/qtcolorpicker/src/qtcolorpicker.cpp
)
set ( QTIPLOT_C_SRC src/zlib123/minigzip.c )
# Suppress compiler warning on file that isn't ours
if ( CMAKE_COMPILER_IS_GNUCXX )
set_source_files_properties ( src/lib/3rdparty/qtcolorpicker/src/qtcolorpicker.cpp
PROPERTIES COMPILE_FLAGS -Wno-cast-qual )
endif ()
set ( MANTID_SRCS src/Mantid/AlgorithmDockWidget.cpp
src/Mantid/AlgorithmMonitor.cpp
src/Mantid/AlgorithmHistoryWindow.cpp
src/Mantid/ErrorBarSettings.cpp
src/Mantid/FirstTimeSetup.cpp
src/Mantid/FitParameterTie.cpp
src/Mantid/IFunctionWrapper.cpp
src/Mantid/ImportWorkspaceDlg.cpp
src/Mantid/InputHistory.cpp
src/Mantid/LabelToolLogValuesDialog.cpp
src/Mantid/ManageCustomMenus.cpp
src/Mantid/ManageInterfaceCategories.cpp
src/Mantid/MantidAbout.cpp
src/Mantid/MantidApplication.cpp
src/Mantid/MantidCurve.cpp
src/Mantid/MantidMatrix.cpp
src/Mantid/MantidMatrixCurve.cpp
src/Mantid/MantidMatrixDxExtensionHandler.cpp
src/Mantid/MantidMatrixExtensionRequest.cpp
src/Mantid/MantidMatrixFunction.cpp
src/Mantid/MantidMatrixModel.cpp
src/Mantid/MantidMDCurve.cpp
src/Mantid/MantidMDCurveDialog.cpp
src/Mantid/MantidMatrixDialog.cpp
src/Mantid/MantidPlotUtilities.cpp
src/Mantid/MantidSampleLogDialog.cpp
src/Mantid/MantidSampleMaterialDialog.cpp
src/Mantid/MantidSurfaceContourPlotGenerator.cpp
src/Mantid/MantidUI.cpp
src/Mantid/MantidTable.cpp
src/Mantid/PeakPickerTool.cpp
src/Mantid/Preferences.cpp
src/Mantid/RemoveErrorsDialog.cpp
src/Mantid/SampleLogDialogBase.cpp
src/Mantid/UserFitFunctionDialog.cpp
src/Mantid/InstrumentWidget/InstrumentWindow.cpp
)
###########################################################################
# Add the headers (so they show up in Visual Studio solutions)
###########################################################################
set ( QTIPLOT_HDRS src/ApplicationWindow.h
src/ArrowMarker.h
src/AssociationsDialog.h
src/AxesDialog.h
src/AxisDetails.h
src/Bar.h
src/BoxCurve.h
src/CanvasPicker.h
src/ColorMapDialog.h
src/Cone3D.h
src/ConfigDialog.h
src/ContourLinesEditor.h
src/Convolution.h
src/Correlation.h
src/cursors.h
src/CurveRangeDialog.h
src/CurvesDialog.h
src/CustomActionDialog.h
src/customevents.h
src/DataPickerTool.h
src/DataSetDialog.h
src/Differentiation.h
src/DockedWindow.h
src/ErrDialog.h
src/ExpDecayDialog.h
src/ExponentialFit.h
src/ExportDialog.h
src/FFTDialog.h
src/FFTFilter.h
src/FFT.h
src/FilterDialog.h
src/Filter.h
src/FindDialog.h
src/FitDialog.h
src/fit_gsl.h
src/Fit.h
src/FitModelHandler.h
src/FloatingWindow.h
src/Folder.h
src/FunctionCurve.h
src/FunctionDialog.h
src/globals.h
src/Graph3D.h
src/Graph.h
src/Grid.h
src/GridDetails.h
src/ImageDialog.h
src/ImageExportDialog.h
src/ImageMarker.h
src/ImportASCIIDialog.h
src/importOPJ.h
src/IntDialog.h
src/Integration.h
src/InterpolationDialog.h
src/Interpolation.h
src/LabelTool.h
src/LayerDialog.h
src/LegendWidget.h
src/LineDialog.h
src/LineProfileTool.h
src/LogisticFit.h
src/MatrixCommand.h
src/MatrixDialog.h
src/Matrix.h
src/MatrixModel.h
src/MatrixSizeDialog.h
src/MatrixValuesDialog.h
src/MdiSubWindow.h
src/MultiLayer.h
src/MultiPeakFit.h
src/MultiPeakFitTool.h
src/muParserScript.h
src/muParserScripting.h
src/MyParser.h
src/NonLinearFit.h
src/Note.h
src/nrutil.h
src/OpenProjectDialog.h
src/Plot3DDialog.h
src/PlotCurve.h
src/PlotDialog.h
src/Plot.h
src/PlotToolInterface.h
src/PlotWizard.h
src/PluginFit.h
src/PolynomFitDialog.h
src/PolynomialFit.h
src/ProjectSerialiser.h
src/ProjectSaveView.h
src/PythonScript.h
src/PythonScripting.h
src/QwtBarCurve.h
src/QwtErrorPlotCurve.h
src/QwtHistogram.h
src/QwtPieCurve.h
src/RangeSelectorTool.h
src/RenameWindowDialog.h
src/resource.h
src/ScaleDetails.h
src/ScaleDraw.h
src/ScalePicker.h
src/ScreenPickerTool.h
src/Scripted.h
src/Script.h
src/ScriptCode.h
src/ScriptingEnv.h
src/ScriptingLangDialog.h
src/ScriptingWindow.h
src/MultiTabScriptInterpreter.h
src/ScriptOutputDisplay.h
src/ScriptFileInterpreter.h
src/SelectionMoveResizer.h
src/SendToProgramDialog.h
src/SetColValuesDialog.h
src/SigmoidalFit.h
src/SmoothCurveDialog.h
src/SmoothFilter.h
src/SortDialog.h
src/Spectrogram.h
src/SurfaceDialog.h
src/TableDialog.h
src/Table.h
src/TableStatistics.h
src/TextDialog.h
src/TextEditor.h
src/TextFileIO.h
src/TiledWindow.h
src/TitlePicker.h
src/TranslateCurveTool.h
src/UserFunction.h
src/VectorCurve.h
src/WindowFactory.h
src/analysis/fft2D.h
src/origin/OPJFile.h
src/plot2D/ImageSymbol.h
src/lib/include/CollapsiveGroupBox.h
src/lib/include/ColorBox.h
src/lib/include/ColorButton.h
src/lib/include/ColorMapEditor.h
src/lib/include/ExtensibleFileDialog.h
src/lib/include/LineNumberDisplay.h
src/lib/include/PatternBox.h
src/lib/include/PenStyleBox.h
src/lib/include/SymbolBox.h
src/lib/include/SymbolDialog.h
src/lib/include/TextFormatButtons.h
src/lib/3rdparty/qtcolorpicker/src/qtcolorpicker.h
)
set ( MANTID_HDRS src/Mantid/AlgorithmMonitor.h
src/Mantid/AlgorithmHistoryWindow.h
src/Mantid/ErrorBarSettings.h
src/Mantid/FirstTimeSetup.h
src/Mantid/FitParameterTie.h
src/Mantid/IFunctionWrapper.h
src/Mantid/ImportWorkspaceDlg.h
src/Mantid/IMantidMatrixExtensionHandler.h
src/Mantid/InputHistory.h
src/Mantid/LabelToolLogValuesDialog.h
src/Mantid/ManageCustomMenus.h
src/Mantid/ManageInterfaceCategories.h
src/Mantid/MantidAbout.h
src/Mantid/MantidApplication.h
src/Mantid/MantidCurve.h
src/Mantid/MantidMatrixCurve.h
src/Mantid/MantidMatrixDxExtensionHandler.h
src/Mantid/MantidMatrixExtensionRequest.h
src/Mantid/MantidMatrixModel.h
src/Mantid/MantidMatrixNullExtensionHandler.h
src/Mantid/MantidMatrixTabExtension.h
src/Mantid/MantidMDCurve.h
src/Mantid/MantidMDCurveDialog.h
src/Mantid/MantidMatrixDialog.h
src/Mantid/MantidMatrix.h
src/Mantid/MantidMatrixFunction.h
src/Mantid/MantidPlotUtilities.h
src/Mantid/MantidSampleLogDialog.h
src/Mantid/MantidSampleMaterialDialog.h
src/Mantid/MantidSurfaceContourPlotGenerator.h
src/Mantid/MantidUI.h
src/Mantid/MantidTable.h
src/Mantid/PeakPickerTool.h
src/Mantid/Preferences.h
src/Mantid/RemoveErrorsDialog.h
src/Mantid/SampleLogDialogBase.h
src/Mantid/UserFitFunctionDialog.h
src/Mantid/InstrumentWidget/InstrumentWindow.h
)
###########################################################################
# Add Qt to the include path
###########################################################################
include ( UseQt4 )
###########################################################################
# Do the sip generation.
###########################################################################
include_directories ( ${PYTHON_INCLUDE_PATH} )
set ( SIP_SPEC ${CMAKE_CURRENT_SOURCE_DIR}/src/qti.sip )
set ( SIP_SRC_IN ${CMAKE_CURRENT_SOURCE_DIR}/src/sipqti.cpp.in )
set ( SIP_SRC ${CMAKE_CURRENT_BINARY_DIR}/sipqti.cpp )
set ( SIP_SRC_AUTO sip_qtipart0.cpp )
# We need to manually add all the headers that are in qti.sip
# so that the dependencies are known to CMake
set ( SIP_HDRS src/MdiSubWindow.h
src/Table.h
src/Matrix.h
src/ArrowMarker.h
src/ImageMarker.h
src/LegendWidget.h
src/Grid.h
src/Graph.h
src/MultiLayer.h
src/Note.h
src/Graph3D.h
src/ApplicationWindow.h
src/Spectrogram.h
src/PythonScripting.h
src/PythonScript.h
src/Folder.h
src/plot2D/ImageSymbol.h
src/Mantid/ErrorBarSettings.h
src/Mantid/MantidUI.h
src/Mantid/MantidMatrix.h
)
set( SRC_UNITY_IGNORE_FILES )
###########################################################################
# Sip generated files
###########################################################################
# The code generated by sip causes compiler warnings therefore the
# generated file is wrapped by ${SIP_SRC} and these warnings are
# disabled. In order for VS2010 to to this correctly the second
# custom command below is required along with the committed
# src/sipqti.cpp.rule file.
add_custom_command ( OUTPUT ${SIP_SRC_AUTO}
COMMAND ${SIP_EXECUTABLE}
-I ${PYQT4_SIP_DIR} -I ${CMAKE_CURRENT_SOURCE_DIR}/../qt/python ${PYQT4_SIP_FLAGS}
-c ${CMAKE_CURRENT_BINARY_DIR} -j1 -w -o
${SIP_SPEC}
DEPENDS src/qti.sip ${SIP_HDRS}
COMMENT "Generating python bindings using sip"
)
add_custom_command ( OUTPUT ${SIP_SRC}
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${SIP_SRC_IN} ${SIP_SRC}
DEPENDS ${SIP_SRC_AUTO}
COMMENT ""
)
# Needed for sip.h header that can end up in a different place to to the main Python include directory
include_directories ( SYSTEM ${SIP_INCLUDE_DIR} )
# Needed for sip generated files to find includes in src
include_directories ( ${CMAKE_CURRENT_SOURCE_DIR} )
###########################################################################
# Specify the files that we need to pass to Qt macros
###########################################################################
set ( QTIPLOT_MOC_FILES src/ApplicationWindow.h
src/AssociationsDialog.h
src/AxesDialog.h
src/AxisDetails.h
src/CanvasPicker.h
src/ColorMapDialog.h
src/ConfigDialog.h
src/ContourLinesEditor.h
src/Convolution.h
src/Correlation.h
src/CurveRangeDialog.h
src/CurvesDialog.h
src/CustomActionDialog.h
src/DataPickerTool.h
src/DataSetDialog.h
src/Differentiation.h
src/DockedWindow.h
src/ErrDialog.h
src/ExpDecayDialog.h
src/ExponentialFit.h
src/ExportDialog.h
src/FFTDialog.h
src/FFTFilter.h
src/FFT.h
src/FilterDialog.h
src/Filter.h
src/FindDialog.h
src/FitDialog.h
src/Fit.h
src/FloatingWindow.h
src/Folder.h
src/FunctionDialog.h
src/Graph3D.h
src/Graph.h
src/Grid.h
src/GridDetails.h
src/ImageDialog.h
src/ImageExportDialog.h
src/ImportASCIIDialog.h
src/IntDialog.h
src/Integration.h
src/InterpolationDialog.h
src/Interpolation.h
src/LabelTool.h
src/LayerDialog.h
src/LegendWidget.h
src/LineDialog.h
src/LineProfileTool.h
src/LogisticFit.h
src/MatrixDialog.h
src/Matrix.h
src/MatrixModel.h
src/MatrixSizeDialog.h
src/MatrixValuesDialog.h
src/MdiSubWindow.h
src/MultiLayer.h
src/MultiPeakFit.h
src/MultiPeakFitTool.h
src/muParserScript.h
src/muParserScripting.h
src/NonLinearFit.h
src/Note.h
src/OpenProjectDialog.h
src/Plot3DDialog.h
src/PlotCurve.h
src/PlotDialog.h
src/Plot.h
src/PlotWizard.h
src/PluginFit.h
src/PolynomFitDialog.h
src/PolynomialFit.h
src/ProjectSaveView.h
src/ProjectSerialiser.h
src/PythonScript.h
src/PythonScripting.h
src/QwtPieCurve.h
src/RangeSelectorTool.h
src/RenameWindowDialog.h
src/ScaleDetails.h
src/ScalePicker.h
src/ScreenPickerTool.h
src/Script.h
src/ScriptingEnv.h
src/ScriptingLangDialog.h
src/ScriptingWindow.h
src/MultiTabScriptInterpreter.h
src/ScriptOutputDisplay.h
src/ScriptFileInterpreter.h
src/SelectionMoveResizer.h
src/SendToProgramDialog.h
src/SetColValuesDialog.h
src/SigmoidalFit.h
src/SmoothCurveDialog.h
src/SmoothFilter.h
src/Spectrogram.h
src/SortDialog.h
src/SurfaceDialog.h
src/TableDialog.h
src/Table.h
src/TableStatistics.h
src/TextDialog.h
src/TextEditor.h
src/TiledWindow.h
src/TitlePicker.h
src/TranslateCurveTool.h
src/lib/include/CollapsiveGroupBox.h
src/lib/include/ColorBox.h
src/lib/include/ColorButton.h
src/lib/include/ColorMapEditor.h
src/lib/include/ExtensibleFileDialog.h
src/lib/include/LineNumberDisplay.h
src/lib/include/PatternBox.h
src/lib/include/PenStyleBox.h
src/lib/include/SymbolBox.h
src/lib/include/SymbolDialog.h
src/lib/include/TextFormatButtons.h
src/lib/3rdparty/qtcolorpicker/src/qtcolorpicker.h
)
set ( MANTID_MOC_FILES src/Mantid/AlgorithmDockWidget.h
src/Mantid/AlgorithmMonitor.h
src/Mantid/AlgorithmHistoryWindow.h
src/Mantid/ErrorBarSettings.h
src/Mantid/FirstTimeSetup.h
src/Mantid/IFunctionWrapper.h
src/Mantid/ImportWorkspaceDlg.h
src/Mantid/LabelToolLogValuesDialog.h
src/Mantid/ManageCustomMenus.h
src/Mantid/ManageInterfaceCategories.h
src/Mantid/MantidAbout.h
src/Mantid/MantidApplication.h
src/Mantid/MantidCurve.h
src/Mantid/MantidMatrixCurve.h
src/Mantid/MantidMDCurve.h
src/Mantid/MantidMDCurveDialog.h
src/Mantid/MantidMatrixDialog.h
src/Mantid/MantidMatrix.h
src/Mantid/MantidMatrixFunction.h
src/Mantid/MantidMatrixModel.h
src/Mantid/MantidSampleLogDialog.h
src/Mantid/MantidSampleMaterialDialog.h
src/Mantid/MantidUI.h
src/Mantid/MantidTable.h
src/Mantid/PeakPickerTool.h
src/Mantid/RemoveErrorsDialog.h
src/Mantid/SampleLogDialogBase.h
src/Mantid/UserFitFunctionDialog.h
src/Mantid/InstrumentWidget/InstrumentWindow.h
)
set ( UI_FILES src/SendToProgramDialog.ui
src/ProjectSave.ui
src/Mantid/FirstTimeSetup.ui
src/Mantid/UserFitFunctionDialog.ui
src/Mantid/MantidAbout.ui
src/Mantid/RemoveErrorsDialog.ui
src/Mantid/ManageCustomMenus.ui
src/Mantid/ManageInterfaceCategories.ui
src/Mantid/MantidMDCurveDialog.ui
src/Mantid/MantidSampleMaterialDialog.ui
)
qt4_wrap_cpp ( MOCCED_FILES ${QTIPLOT_MOC_FILES} ${MANTID_MOC_FILES} )
# Call separate function on third-party code that expects moc output to have certain name
qt4_generate_moc ( src/lib/3rdparty/qtcolorpicker/src/qtcolorpicker.cpp
${CMAKE_CURRENT_BINARY_DIR}/qtcolorpicker.moc )
set_source_files_properties ( ${CMAKE_CURRENT_BINARY_DIR}/qtcolorpicker.moc
PROPERTIES HEADER_FILE_ONLY true )
set ( MOCCED_FILES ${MOCCED_FILES} ${CMAKE_CURRENT_BINARY_DIR}/qtcolorpicker.moc )
set ( SRC_FILES ${QTIPLOT_SRCS} ${MANTID_SRCS} ${SIP_SRC} )
set ( INC_FILES ${QTIPLOT_HDRS} ${MANTID_HDRS} )
if ( WIN32 )
set ( MANIFEST_FILES MantidPlot.manifest )
endif ()
set ( ALL_SRC ${SRC_FILES} ${MOCCED_FILES} ${MANIFEST_FILES} )
# Use a precompiled header where they are supported
enable_precompiled_headers( src/PrecompiledHeader.h ALL_SRC )
qt4_wrap_ui ( UI_HDRS ${UI_FILES} )
# The generated ui headers will go here:
include_directories ( ${CMAKE_CURRENT_BINARY_DIR} )
###########################################################################
# Internal icon links
###########################################################################
qt4_add_resources ( RES_FILES ${PROJECT_SOURCE_DIR}/images/images.qrc )
qt4_add_resources ( RES_FILES ${PROJECT_SOURCE_DIR}/images/MantidWidgets.qrc )
qt4_add_resources ( RES_FILES ${PROJECT_SOURCE_DIR}/images//fonts/fonts.qrc )
qt4_add_resources ( RES_FILES ${CMAKE_CURRENT_SOURCE_DIR}/icons/icons.qrc )
###########################################################################
# Add the dependencies
###########################################################################
if(MAKE_VATES)
include( ${PARAVIEW_USE_FILE} )
endif()
include_directories ( SYSTEM ${MUPARSER_INCLUDE_DIR} )
include_directories ( ${ZLIB_INCLUDE_DIRS} )
include_directories ( SYSTEM ${QWT_INCLUDE_DIR} )
find_package ( QwtPlot3d REQUIRED )
include_directories ( SYSTEM ${QWTPLOT3D_INCLUDE_DIR} )
find_package ( QScintilla REQUIRED )
include_directories ( ${QSCINTILLA_INCLUDE_DIR} )
###########################################################################
# Now create the target and add its dependencies and flags
###########################################################################
add_definitions ( -DSCRIPTING_MUPARSER )
add_definitions ( -DSCRIPTING_PYTHON )
add_definitions ( -DQSCINTILLA_DLL ) # Will only have an effect on Windows (as is desired)
include_directories ( src )
include_directories ( src/lib/include )
include_directories ( src/lib/3rdparty/qtcolorpicker/src )
include_directories ( ../qt/widgets/common/inc )
include_directories ( ../qt/widgets/instrumentview/inc )
include_directories ( ../qt/widgets/sliceviewer/inc )
include_directories ( ../qt/widgets/spectrumviewer/inc )
include_directories ( ../qt/widgets/factory/inc )
# ui_ files end up in these places
include_directories ( ${CMAKE_BINARY_DIR}/qt/widgets/common )
include_directories ( ${CMAKE_BINARY_DIR}/qt/widgets/sliceviewer )
###########################################################################
# Application icon files
###########################################################################
if( WIN32 )
set ( MANTID_RC_FILE icons/MantidPlotDesktop.rc )
if ( CONSOLE )
set ( WIN_CONSOLE )
else ()
set( WIN_CONSOLE WIN32 )
endif( CONSOLE )
endif( WIN32 )
if ( APPLE )
set ( MANTID_RC_FILE ${CMAKE_SOURCE_DIR}/images/MantidPlot.icns )
set_source_files_properties(MANTID_RC_FILE PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
endif ()
###########################################################################
# Config reset scripts
###########################################################################
if ( WIN32 )
set ( CONFIG_RESET_SCRIPT mantid_reset_settings.bat )
else ()
set ( CONFIG_RESET_SCRIPT mantid_reset_settings.sh )
endif ()
copy_files_to_dir ( "${CONFIG_RESET_SCRIPT}"
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}
CONFIG_RESET_SCRIPT_FILE )
###########################################################################
# Required Python config files
###########################################################################
# Top-level python scripts
set( PY_FILES mantidplot.py mantidplotrc.py mantid_qt_settings_editor.py)
copy_files_to_dir ( "${PY_FILES}"
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}
PYTHON_INSTALL_FILES )
# mantidplot package
set( MTDPLOTPY_FILES
__init__.py
proxies.py
pyplot.py
qtiplot.py
)
copy_files_to_dir ( "${MTDPLOTPY_FILES}"
${CMAKE_CURRENT_SOURCE_DIR}/pymantidplot
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/pymantidplot
MTDPLOT_INSTALL_FILES )
set( MTDPLOTPYMPL_FILES
__init__.py
backend_mtdqt4agg.py
)
copy_files_to_dir ( "${MTDPLOTPYMPL_FILES}"
${CMAKE_CURRENT_SOURCE_DIR}/pymantidplot/mpl
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/pymantidplot/mpl
MTDPLOTMPL_INSTALL_FILES )
# IPython scripts
set( IPY_FILES
__init__.py
mantid_ipython_widget.py
)
copy_files_to_dir ( "${IPY_FILES}"
${CMAKE_CURRENT_SOURCE_DIR}/ipython_widget
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/ipython_widget
IPYTHON_INSTALL_FILES )
###########################################################################
# MantidPlot executable
###########################################################################
add_executable ( MantidPlot ${WIN_CONSOLE} MACOSX_BUNDLE ${ALL_SRC} src/main.cpp
${INC_FILES} ${QTIPLOT_C_SRC} ${UI_HDRS}
${RES_FILES} ${MANTID_RC_FILE}
${PYTHON_INSTALL_FILES} ${MTDPLOT_INSTALL_FILES} ${MTDPLOTMPL_INSTALL_FILES}
${CONFIG_RESET_SCRIPT_FILE} ${IPYTHON_INSTALL_FILES}
)
# Library dependencies
target_link_libraries ( MantidPlot LINK_PRIVATE ${TCMALLOC_LIBRARIES_LINKTIME}
${CORE_MANTIDLIBS}
MantidQtWidgetsCommon
MantidQtWidgetsInstrumentView
MantidQtWidgetsSliceViewer
MantidQtWidgetsFactory
MantidQtWidgetsSpectrumViewer
${Boost_LIBRARIES}
${POCO_LIBRARIES}
${GSL_LIBRARIES}
${MUPARSER_LIBRARIES}
${QT_LIBRARIES}
${QWT_LIBRARIES}
${QWTPLOT3D_LIBRARIES}
${QSCINTILLA_LIBRARIES}
${PYTHON_LIBRARIES}
${ZLIB_LIBRARIES}
${OPENGL_LIBRARIES}
)
if(MAKE_VATES)
target_include_directories( MantidPlot SYSTEM PRIVATE ${PARAVIEW_INCLUDE_DIRS} )
target_link_libraries ( MantidPlot LINK_PRIVATE vtkPVClientServerCoreRendering )
endif()
if (WITH_ASAN)
target_link_libraries ( MantidPlot LINK_PRIVATE -lasan )
endif ()
# Plugin dependencies
add_dependencies( MantidPlot mantidqtpython CompilePyUI )
if (OSX_VERSION VERSION_GREATER 10.8)
set_target_properties(MantidPlot PROPERTIES INSTALL_RPATH "@executable_path;@executable_path/../Libraries")
endif ()
###########################################################################
# Custom Info.plist file for OS X
###########################################################################
if( APPLE )
# Setting the CFBundleIdentifer attribute on OS X 10.6 (SL) and before
# causes problems with trying to install the package on the same
# machine as it was built. It tries to relocate the package to the build directory
# because the bundle identifiers match. Mountain Lion requires the attribute
# to avoid crashes when accessing certain system dialogs from Qt.
# The ideal would be to pass the --no-relocate
# option to packagemaker but we can't control that so only set the
# identifier for 10.7 and above
#
# This can disappear when if/when we move to a drag-n-drop package.
if (OSX_VERSION VERSION_GREATER 10.7 OR OSX_VERSION VERSION_EQUAL 10.7)
set ( MAC_BUNDLE_IDENTIFIER "org.mantidproject.MantidPlot" )
else()
set ( MAC_BUNDLE_IDENTIFIER "" )
endif()
configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/../installers/MacInstaller/Info.plist.in
${CMAKE_CURRENT_BINARY_DIR}/Info.plist
@ONLY )
set_target_properties( MantidPlot PROPERTIES MACOSX_BUNDLE_INFO_PLIST
${CMAKE_CURRENT_BINARY_DIR}/Info.plist )
endif()
###########################################################################
# Entry point flag for Windows to ensure we always link to standard main
###########################################################################
if( WIN32 )
set_target_properties( MantidPlot PROPERTIES LINK_FLAGS "/ENTRY:mainCRTStartup" )
if ( CONSOLE )
set_target_properties( MantidPlot PROPERTIES COMPILE_DEFINITIONS "_CONSOLE" )
endif ( CONSOLE )
endif( WIN32 )
###########################################################################
# MantidPlot Python Unit Tests
###########################################################################
# List of .py files than must be run WITHIN MantidPlot.
set ( MANTIDPLOT_TEST_PY_FILES
MantidPlotAlgorithmDialogTest.py
MantidPlotInstrumentViewTest.py
MantidPlotSliceViewerTest.py
MantidPlot1DPlotTest.py
MantidPlot2DPlotTest.py
MantidPlotMatplotlibTest.py
MantidPlotProjectSerialiseTest.py
MantidPlotProxiesTest.py
MantidPlotPythonImportTest.py
MantidPlotFoldersTest.py
MantidPlotMdiSubWindowTest.py
MantidPlotTiledWindowTest.py
MantidPlotInputArgsCheck.py
MantidPlotPyplotGeneralTest.py
)
if ( MAKE_VATES )
list ( APPEND MANTIDPLOT_TEST_PY_FILES MantidPlotPVPythonTest.py )
endif ()
if ( 0 )
message (STATUS "Your CMAKE_SYSTEM string is '${CMAKE_SYSTEM}'")
message (STATUS "Your CMAKE_SYSTEM_NAME string is '${CMAKE_SYSTEM_NAME}'")
message (STATUS "Your CMAKE_BINARY_DIR string is '${CMAKE_BINARY_DIR}'")
message (STATUS "Your BIN_DIR string is '${BIN_DIR}'")
message (STATUS "Your CMAKE_LIBRARY_OUTPUT_DIRECTORY string is '${CMAKE_LIBRARY_OUTPUT_DIRECTORY}'")
message (STATUS "Your CMAKE_CFG_INTDIR string is '${CMAKE_CFG_INTDIR}'")
message (STATUS "Your CMAKE_CURRENT_BINARY_DIR string is '${CMAKE_CURRENT_BINARY_DIR}'")
endif ()
# Check system version
if ( ${CMAKE_SYSTEM} MATCHES ".*\\.el5" )
# This is RHEL5. GUI tests hang on this platform for some reason
message ( "RHEL5 hangs on GUI tests. Disabling MantidPlot python tests." )
else ()
# Find the path to the built MantidPlot app. Need different paths for MAC for some reason.
set (MANTIDPLOT_PATH "${CMAKE_BINARY_DIR}/${BIN_DIR}/MantidPlot" )
# Screenshots destination
if ("$ENV{WORKSPACE}" STREQUAL "")
set (SCREENSHOTS_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/screenshots" )
else ()
set (SCREENSHOTS_DIR "$ENV{WORKSPACE}/screenshots" )
endif ()
# Add an environment property MANTID_SOURCE so that the script can find the source of xmlrunner
set (TEST_ENVIRONMENT "MANTID_SOURCE=${CMAKE_SOURCE_DIR};PYTHONPATH=${PYTHON_XMLRUNNER_DIR};MANTID_SCREENSHOT_REPORT=${SCREENSHOTS_DIR}" )
# Fixes for Darwin (MacOS)
if ( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set (MANTIDPLOT_PATH "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BIN_DIR}/MantidPlot" )
# Append to the path and set MANTIDPATH for MacOS' MantidPlot to run
set (TEST_ENVIRONMENT "PATH=$ENV{PATH}:${CMAKE_LIBRARY_OUTPUT_DIRECTORY};MANTIDPATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY};MANTID_SOURCE=${CMAKE_SOURCE_DIR};PYTHONPATH=${PYTHON_XMLRUNNER_DIR};MANTID_SCREENSHOT_REPORT=${SCREENSHOTS_DIR}" )
endif ()
# Make a ctest target for each file
foreach ( PYFILE ${MANTIDPLOT_TEST_PY_FILES} )
# Add the test. Name of test = name of the file
add_test ( ${PYFILE} ${MANTIDPLOT_PATH} -xq ${CMAKE_CURRENT_SOURCE_DIR}/test/${PYFILE} )
# Set the previously-built environment
set_tests_properties ( ${PYFILE} PROPERTIES
RUN_SERIAL 1
ENVIRONMENT "${TEST_ENVIRONMENT}"
TIMEOUT ${TESTING_TIMEOUT} )
endforeach ()
add_dependencies( GUITests MantidPlot )
endif()
###########################################################################
# Installation settings
###########################################################################
install ( TARGETS MantidPlot RUNTIME DESTINATION ${BIN_DIR}
BUNDLE DESTINATION .
)
# Ship required files. Explicit so some can be disabled easily if necessary
install ( FILES ${PY_FILES} DESTINATION ${BIN_DIR} )
foreach(PY_FILE ${MTDPLOTPY_FILES} )
install ( FILES pymantidplot/${PY_FILE} DESTINATION ${BIN_DIR}/pymantidplot )
endforeach()
foreach(PY_FILE ${MTDPLOTPYMPL_FILES} )
install ( FILES pymantidplot/mpl/${PY_FILE} DESTINATION ${BIN_DIR}/pymantidplot/mpl )
endforeach()
foreach(PY_FILE ${IPY_FILES} )
install ( FILES ipython_widget/${PY_FILE} DESTINATION ${BIN_DIR}/ipython_widget )
endforeach()
install ( FILES ${CONFIG_RESET_SCRIPT} DESTINATION ${BIN_DIR} )
# file make_package.rb contains hard-coded path to the libraries
# this causes fail of the installation with macports
# therefore MACPORTS option is introduced
if ( APPLE )
if (OSX_VERSION VERSION_LESS 10.9)
configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/FixBundle.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/FixBundle.cmake
@ONLY )
install ( SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/FixBundle.cmake )
elseif (MACPORTS)
install ( FILES package_python_macports.py DESTINATION MantidPlot.app/ )
configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/FixMacportsBundle.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/FixMacportsBundle.cmake
@ONLY )
install ( SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/FixMacportsBundle.cmake )
else ()
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/make_package.rb.in
${CMAKE_CURRENT_BINARY_DIR}/make_package.rb
@ONLY )
install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/make_package.rb DESTINATION MantidPlot.app/ )
configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/FixMavericksBundle.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/FixMavericksBundle.cmake
@ONLY )
install ( SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/FixMavericksBundle.cmake )
endif ()
endif ()