-
Notifications
You must be signed in to change notification settings - Fork 121
/
CMakeLists.txt
130 lines (117 loc) · 4.93 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
#############################################################################################
# _api Python module
#############################################################################################
set ( MODULE_TEMPLATE src/api.cpp.in )
# Files containing export definitions, these are automatically processed
# -- Do NOT sort this list. The order defines the order in which the export
# definitions occur and some depend on their base classes being exported first --
set ( EXPORT_FILES
src/Exports/IAlgorithm.cpp
src/Exports/AlgorithmProxy.cpp
src/Exports/DeprecatedAlgorithmChecker.cpp
src/Exports/Algorithm.cpp
src/Exports/DataProcessorAlgorithm.cpp
src/Exports/AlgorithmFactory.cpp
src/Exports/AlgorithmManager.cpp
src/Exports/AnalysisDataService.cpp
src/Exports/FileProperty.cpp
src/Exports/MultipleFileProperty.cpp
src/Exports/FrameworkManager.cpp
src/Exports/IEventList.cpp
src/Exports/ISpectrum.cpp
src/Exports/WorkspaceHistory.cpp
src/Exports/ExperimentInfo.cpp
src/Exports/MultipleExperimentInfos.cpp
src/Exports/Workspace.cpp
src/Exports/IWorkspaceProperty.cpp
src/Exports/WorkspaceProperty.cpp
src/Exports/ITableWorkspace.cpp
src/Exports/ITableWorkspaceProperty.cpp
src/Exports/MDGeometry.cpp
src/Exports/IMDWorkspace.cpp
src/Exports/IMDHistoWorkspace.cpp
src/Exports/IMDHistoWorkspaceProperty.cpp
src/Exports/IMDEventWorkspace.cpp
src/Exports/MatrixWorkspace.cpp
src/Exports/IMaskWorkspace.cpp
src/Exports/MatrixWorkspaceProperty.cpp
src/Exports/IEventWorkspace.cpp
src/Exports/IEventWorkspaceProperty.cpp
src/Exports/IPeaksWorkspace.cpp
src/Exports/BinaryOperations.cpp
src/Exports/WorkspaceGroup.cpp
src/Exports/WorkspaceGroupProperty.cpp
src/Exports/WorkspaceValidators.cpp
src/Exports/InstrumentValidator.cpp
src/Exports/Axis.cpp
src/Exports/IPeak.cpp
src/Exports/BoxController.cpp
src/Exports/FileFinder.cpp
src/Exports/Sample.cpp
src/Exports/ScriptRepository.cpp
src/Exports/ScriptRepositoryFactory.cpp
src/Exports/Run.cpp
src/Exports/WorkspaceFactory.cpp
src/Exports/IFunction.cpp
src/Exports/IFunction1D.cpp
src/Exports/IPeakFunction.cpp
src/Exports/Jacobian.cpp
src/Exports/PropertyManagerDataService.cpp
src/Exports/FunctionFactory.cpp
src/Exports/Progress.cpp
src/Exports/FunctionProperty.cpp
src/Exports/AlgorithmProperty.cpp
)
# Files containing additional helper code that are not related to exporting class/functions
set ( SRC_FILES
src/Algorithms/RunPythonScript.cpp
src/FitFunctions/IFunctionAdapter.cpp
src/FitFunctions/IFunction1DAdapter.cpp
src/FitFunctions/IPeakFunctionAdapter.cpp
src/PythonAlgorithm/AlgorithmAdapter.cpp
src/PythonAlgorithm/DataProcessorAdapter.cpp
src/CloneMatrixWorkspace.cpp
)
set ( INC_FILES
${HEADER_DIR}/api/Algorithms/RunPythonScript.h
${HEADER_DIR}/api/FitFunctions/IFunctionAdapter.h
${HEADER_DIR}/api/FitFunctions/IFunction1DAdapter.h
${HEADER_DIR}/api/FitFunctions/IPeakFunctionAdapter.h
${HEADER_DIR}/api/PythonAlgorithm/AlgorithmAdapter.h
${HEADER_DIR}/api/PythonAlgorithm/DataProcessorAdapter.h
${HEADER_DIR}/api/BinaryOperations.h
${HEADER_DIR}/api/CloneMatrixWorkspace.h
${HEADER_DIR}/api/WorkspacePropertyExporter.h
)
set ( PY_FILES
__init__.py
_adsimports.py
_aliases.py
_workspaceops.py
)
#############################################################################################
# Generate a source file from the export definitions
#############################################################################################
create_module ( ${MODULE_TEMPLATE} ${CMAKE_CURRENT_BINARY_DIR}/api.cpp EXPORT_FILES
SRC_FILES )
#############################################################################################
# Copy over the pure Python files for the module
#############################################################################################
# Set the destination directory
set ( OUTPUT_DIR ${PYTHON_PKG_ROOT}/api )
copy_python_files_to_dir ( "${PY_FILES}" ${CMAKE_CURRENT_SOURCE_DIR} ${OUTPUT_DIR}
PYTHON_INSTALL_FILES )
#############################################################################################
# Create the target for this directory
#############################################################################################
add_library ( PythonAPIModule ${SRC_FILES} ${INC_FILES} ${PYTHON_INSTALL_FILES} )
set_python_properties( PythonAPIModule _api )
set_target_output_directory ( PythonAPIModule ${OUTPUT_DIR} .pyd )
# Add the required dependencies
target_link_libraries ( PythonAPIModule PythonGeometryModule PythonKernelModule ${PYTHON_DEPS} )
###########################################################################
# Installation settings
###########################################################################
install ( TARGETS PythonAPIModule ${SYSTEM_PACKAGE_TARGET} DESTINATION ${BIN_DIR}/mantid/api )
# Pure Python files
install ( FILES ${PY_FILES} DESTINATION ${BIN_DIR}/mantid/api )