CMakeLists.txt 4.45 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
set(SRC_FILES
    src/AlphaCalc.cpp
    src/ApplyDeadTimeCorr.cpp
    src/ApplyMuonDetectorGrouping.cpp
    src/ApplyMuonDetectorGroupPairing.cpp
    src/AsymmetryCalc.cpp
    src/CalculateMuonAsymmetry.cpp
    src/CalMuonDeadTime.cpp
    src/CalMuonDetectorPhases.cpp
    src/ConvertFitFunctionForMuonTFAsymmetry.cpp
    src/LoadAndApplyMuonDetectorGrouping.cpp
    src/EstimateMuonAsymmetryFromCounts.cpp
    src/MuonAlgorithmHelper.cpp
    src/MuonAsymmetryHelper.cpp
    src/MuonGroupDetectors.cpp
    src/MuonGroupingCounts.cpp
    src/MuonGroupingAsymmetry.cpp
    src/MuonPreProcess.cpp
19
    src/PSIBackgroundSubtraction.cpp
20
21
22
23
24
    src/MuonPairingAsymmetry.cpp
    src/PhaseQuadMuon.cpp
    src/PlotAsymmetryByLogValue.cpp
    src/RemoveExpDecay.cpp
    src/RRFMuon.cpp)
25

26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
set(INC_FILES
    inc/MantidMuon/AlphaCalc.h
    inc/MantidMuon/ApplyDeadTimeCorr.h
    inc/MantidMuon/ApplyMuonDetectorGrouping.h
    inc/MantidMuon/ApplyMuonDetectorGroupPairing.h
    inc/MantidMuon/AsymmetryCalc.h
    inc/MantidMuon/CalculateMuonAsymmetry.h
    inc/MantidMuon/CalMuonDeadTime.h
    inc/MantidMuon/CalMuonDetectorPhases.h
    inc/MantidMuon/ConvertFitFunctionForMuonTFAsymmetry.h
    inc/MantidMuon/LoadAndApplyMuonDetectorGrouping.h
    inc/MantidMuon/EstimateMuonAsymmetryFromCounts.h
    inc/MantidMuon/MuonAlgorithmHelper.h
    inc/MantidMuon/MuonAsymmetryHelper.h
    inc/MantidMuon/MuonGroupDetectors.h
    inc/MantidMuon/MuonGroupingCounts.h
    inc/MantidMuon/MuonPairingAsymmetry.h
    inc/MantidMuon/MuonGroupingAsymmetry.h
    inc/MantidMuon/MuonPreProcess.h
45
    inc/MantidMuon/PSIBackgroundSubtraction.h
46
47
48
49
    inc/MantidMuon/PhaseQuadMuon.h
    inc/MantidMuon/PlotAsymmetryByLogValue.h
    inc/MantidMuon/RemoveExpDecay.h
    inc/MantidMuon/RRFMuon.h)
50

51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
set(TEST_FILES
    AlphaCalcTest.h
    ApplyDeadTimeCorrTest.h
    ApplyMuonDetectorGroupingTest.h
    ApplyMuonDetectorGroupPairingTest.h
    AsymmetryCalcTest.h
    CalculateMuonAsymmetryTest.h
    CalMuonDeadTimeTest.h
    CalMuonDetectorPhasesTest.h
    ConvertFitFunctionForMuonTFAsymmetryTest.h
    LoadAndApplyMuonDetectorGroupingTest.h
    MuonAlgorithmHelperTest.h
    EstimateMuonAsymmetryFromCountsTest.h
    MuonGroupDetectorsTest.h
    MuonPairingAsymmetryTest.h
    MuonGroupingCountsTest.h
    MuonGroupingAsymmetryTest.h
    MuonPreProcessTest.h
69
    PSIBackgroundSubtractionTest.h
70
71
72
73
    PhaseQuadMuonTest.h
    PlotAsymmetryByLogValueTest.h
    RemoveExpDecayTest.h
    RRFMuonTest.h)
74

75
if(COVERAGE)
76
77
78
79
80
  foreach(loop_var ${SRC_FILES} ${C_SRC_FILES} ${INC_FILES})
    set_property(GLOBAL APPEND
                 PROPERTY COVERAGE_SRCS
                          "${CMAKE_CURRENT_SOURCE_DIR}/${loop_var}")
  endforeach(loop_var)
81
82
endif()

83
# Add a precompiled header where they are supported
84
85
# enable_precompiled_headers (inc/MantidAlgorithms/PrecompiledHeader.h SRC_FILES )
# Add the target for this directory
86
add_library(Muon ${SRC_FILES} ${C_SRC_FILES} ${INC_FILES})
Stephen's avatar
Stephen committed
87
88
89
90
91
92
add_library(Mantid::Muon ALIAS Muon)

target_include_directories(Muon PUBLIC
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc>
		$<INSTALL_INTERFACE:include/Mantid>
)
93
# Set the name of the generated library
94
95
96
97
98
set_target_properties(Muon
                      PROPERTIES OUTPUT_NAME
                                 MantidMuon
                                 COMPILE_DEFINITIONS
                                 "IN_MANTID_MUON")
99

100
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
101
102
103
104
  set_target_properties(Muon
                        PROPERTIES INSTALL_RPATH
                                   "@loader_path/../Contents/MacOS")
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
105
  set_target_properties(Muon PROPERTIES INSTALL_RPATH "\$ORIGIN/../${LIB_DIR}")
106
endif()
107
108

# Add to the 'Framework' group in VS
109
set_property(TARGET Muon PROPERTY FOLDER "MantidFramework")
110

Stephen's avatar
Stephen committed
111
target_link_libraries(Muon PUBLIC Mantid::API Mantid::Kernel Mantid::Muon Mantid::Geometry PRIVATE Mantid::DataObjects Mantid::Indexing)
112
# Add the unit tests directory
113
add_subdirectory(test)
114

115
# Auto-generate exports header
Stephen's avatar
Stephen committed
116
117
118
119
target_include_directories(Muon PUBLIC
  $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/Framework/Muon>
  $<INSTALL_INTERFACE:include/Mantid>
)
120
generate_mantid_export_header(Muon FALSE)
121

122
# Installation settings
Stephen's avatar
Stephen committed
123
124
125
126
127
128
129
130
set(TARGET_EXPORT_NAME "MantidMuonTargets")
mtd_install_dylib(TARGETS Muon INSTALL_EXPORT_FILE EXPORT_NAME ${TARGET_EXPORT_NAME} INSTALL_DIRS ${LIB_DIR} ${WORKBENCH_LIB_DIR})

install(EXPORT ${TARGET_EXPORT_NAME}
        FILE ${TARGET_EXPORT_NAME}.cmake
        NAMESPACE Mantid::
        DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MantidFramework
)