CMakeLists.txt 5.21 KB
Newer Older
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
set(SRC_FILES
    src/CalculateSlits.cpp
    src/ConvertToReflectometryQ.cpp
    src/CreateTransmissionWorkspace2.cpp
    src/CreateTransmissionWorkspaceAuto2.cpp
    src/FindReflectometryLines2.cpp
    src/NRCalculateSlitResolution.cpp
    src/ReflectometryBackgroundSubtraction.cpp
    src/ReflectometryBeamStatistics.cpp
    src/ReflectometryMomentumTransfer.cpp
    src/ReflectometryReductionOne2.cpp
    src/ReflectometryReductionOneAuto2.cpp
    src/ReflectometryReductionOneAuto3.cpp
    src/ReflectometryTransformKiKf.cpp
    src/ReflectometryTransformP.cpp
    src/ReflectometryTransformQxQz.cpp
    src/ReflectometrySumInQ.cpp
    src/ReflectometryWorkflowBase2.cpp
    src/RefRoi.cpp
    src/SpecularReflectionAlgorithm.cpp
    src/SpecularReflectionCalculateTheta.cpp
    src/SpecularReflectionCalculateTheta2.cpp
    src/SpecularReflectionPositionCorrect.cpp
    src/SpecularReflectionPositionCorrect2.cpp)

set(INC_FILES
    inc/MantidReflectometry/CalculateSlits.h
    inc/MantidReflectometry/ConvertToReflectometryQ.h
    inc/MantidReflectometry/CreateTransmissionWorkspace2.h
    inc/MantidReflectometry/CreateTransmissionWorkspaceAuto2.h
    inc/MantidReflectometry/FindReflectometryLines2.h
    inc/MantidReflectometry/NRCalculateSlitResolution.h
    inc/MantidReflectometry/ReflectometryBackgroundSubtraction.h
    inc/MantidReflectometry/ReflectometryBeamStatistics.h
    inc/MantidReflectometry/ReflectometryMomentumTransfer.h
    inc/MantidReflectometry/ReflectometryReductionOne2.h
    inc/MantidReflectometry/ReflectometryReductionOneAuto2.h
    inc/MantidReflectometry/ReflectometryReductionOneAuto3.h
    inc/MantidReflectometry/ReflectometryTransformKiKf.h
    inc/MantidReflectometry/ReflectometryTransformP.h
    inc/MantidReflectometry/ReflectometryTransformQxQz.h
    inc/MantidReflectometry/ReflectometrySumInQ.h
    inc/MantidReflectometry/ReflectometryWorkflowBase2.h
    inc/MantidReflectometry/RefRoi.h
    inc/MantidReflectometry/SpecularReflectionAlgorithm.h
    inc/MantidReflectometry/SpecularReflectionCalculateTheta.h
    inc/MantidReflectometry/SpecularReflectionCalculateTheta2.h
    inc/MantidReflectometry/SpecularReflectionPositionCorrect.h
    inc/MantidReflectometry/SpecularReflectionPositionCorrect2.h)

set(TEST_FILES
    CalculateSlitsTest.h
    ConvertToReflectometryQTest.h
    CreateTransmissionWorkspace2Test.h
    CreateTransmissionWorkspaceAuto2Test.h
    FindReflectometryLines2Test.h
    NRCalculateSlitResolutionTest.h
    ReflectometryBeamStatisticsTest.h
    ReflectometryMomentumTransferTest.h
    ReflectometryReductionOne2Test.h
    ReflectometryReductionOneAuto2Test.h
    ReflectometryReductionOneAuto3Test.h
    ReflectometryTransformKiKfTest.h
    ReflectometryTransformPTest.h
    ReflectometryTransformQxQzTest.h
    ReflectometrySumInQTest.h
    SpecularReflectionCalculateTheta2Test.h
    SpecularReflectionCalculateThetaTest.h
    SpecularReflectionPositionCorrect2Test.h
    SpecularReflectionPositionCorrectTest.h)

set(TEST_PY_FILES
    ReflectometryBackgroundSubtractionTest.py
    ReflectometryReductionOne2Test.py)

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

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

target_include_directories(Reflectometry PUBLIC
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc>
		$<INSTALL_INTERFACE:include/Mantid>
)

95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# Set the name of the generated library
set_target_properties(Reflectometry
                      PROPERTIES OUTPUT_NAME
                                 MantidReflectometry
                                 COMPILE_DEFINITIONS
                                 "IN_MANTID_REFLECTOMETRY")

if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
  set_target_properties(Reflectometry
                        PROPERTIES INSTALL_RPATH
                                   "@loader_path/../Contents/MacOS")
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
  set_target_properties(Reflectometry PROPERTIES INSTALL_RPATH "\$ORIGIN/../${LIB_DIR}")
endif()

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

Stephen's avatar
Stephen committed
113
target_link_libraries(Reflectometry PUBLIC Mantid::Kernel Mantid::API Mantid::Geometry Mantid::DataObjects PRIVATE Mantid::Indexing Mantid::HistogramData)
114
115
116
117

# Add the unit tests directory
add_subdirectory(test)

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

125
# Installation settings
Stephen's avatar
Stephen committed
126
127
128
129
130
131
132
133
set(TARGET_EXPORT_NAME "MantidReflectometryTargets")
mtd_install_dylib(TARGETS Reflectometry 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
)