forked from AmbaPant/mantid
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
131 lines (112 loc) · 4.22 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
set(SRC_FILES
src/Communicator.cpp
src/ExecutionMode.cpp
src/IO/Chunker.cpp
src/IO/EventLoader.cpp
src/IO/EventParser.cpp
src/IO/EventsListsShmemManager.cpp
src/IO/EventsListsShmemStorage.cpp
src/IO/MultiProcessEventLoader.cpp
src/IO/NXEventDataLoader.cpp
src/IO/EventLoaderChild.cpp
src/Request.cpp
src/StorageMode.cpp
src/ThreadingBackend.cpp
src/IO/EventLoaderHelpers.cpp
)
set(INC_FILES
inc/MantidParallel/Collectives.h
inc/MantidParallel/Communicator.h
inc/MantidParallel/ExecutionMode.h
inc/MantidParallel/IO/Chunker.h
inc/MantidParallel/IO/EventDataPartitioner.h
inc/MantidParallel/IO/EventLoader.h
inc/MantidParallel/IO/EventLoaderHelpers.h
inc/MantidParallel/IO/EventParser.h
inc/MantidParallel/IO/EventsListsShmemManager.h
inc/MantidParallel/IO/EventsListsShmemStorage.h
inc/MantidParallel/IO/MultiProcessEventLoader.h
inc/MantidParallel/IO/NXEventDataLoader.h
inc/MantidParallel/IO/NXEventDataSource.h
inc/MantidParallel/IO/PulseTimeGenerator.h
inc/MantidParallel/Nonblocking.h
inc/MantidParallel/Request.h
inc/MantidParallel/Status.h
inc/MantidParallel/StorageMode.h
inc/MantidParallel/ThreadingBackend.h
)
set(TEST_FILES
ChunkerTest.h
CollectivesTest.h
CommunicatorTest.h
EventDataPartitionerTest.h
EventLoaderTest.h
EventParserTest.h
ExecutionModeTest.h
NonblockingTest.h
ParallelRunnerTest.h
PulseTimeGeneratorTest.h
RequestTest.h
StorageModeTest.h
ThreadingBackendTest.h
)
if(COVERAGE)
foreach(loop_var ${SRC_FILES} ${INC_FILES})
set_property(GLOBAL APPEND PROPERTY COVERAGE_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/${loop_var}")
endforeach(loop_var)
endif()
# Add the target for this directory
add_library(Parallel ${SRC_FILES} ${INC_FILES})
add_library(Mantid::Parallel ALIAS Parallel)
add_dependencies(Parallel EventParallelLoader Mantid::Kernel)
target_include_directories(
Parallel PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc> $<INSTALL_INTERFACE:include/Mantid>
)
# Set the name of the generated library
set_target_properties(Parallel PROPERTIES OUTPUT_NAME MantidParallel COMPILE_DEFINITIONS IN_MANTID_PARALLEL)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set_target_properties(Parallel PROPERTIES INSTALL_RPATH "@loader_path/../MacOS;@loader_path/../Frameworks")
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set_target_properties(Parallel PROPERTIES INSTALL_RPATH "\$ORIGIN/../${LIB_DIR}")
endif()
# Add to the 'Framework' group in VS
set_property(TARGET Parallel PROPERTY FOLDER "MantidFramework")
target_link_libraries(Parallel PUBLIC Mantid::Kernel Boost::serialization)
if(UNIX AND NOT APPLE)
target_link_libraries(Parallel PRIVATE rt)
endif()
# Add executable for Nexus parallel loader child process
add_executable(EventParallelLoader ${SRC_FILES} ${INC_FILES})
target_include_directories(
EventParallelLoader PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc> $<INSTALL_INTERFACE:include/Mantid>
)
add_dependencies(EventParallelLoader Mantid::Kernel)
# set the name of generated executable
set_target_properties(
EventParallelLoader PROPERTIES OUTPUT_NAME MantidNexusParallelLoader COMPILE_DEFINITIONS IN_MANTID_PARALLEL
)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set_target_properties(EventParallelLoader PROPERTIES INSTALL_RPATH "@loader_path/../MacOS;@loader_path/../Frameworks")
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set_target_properties(EventParallelLoader PROPERTIES INSTALL_RPATH "\$ORIGIN/../${LIB_DIR}")
endif()
# Add to the 'Framework' group in VS
set_property(TARGET EventParallelLoader PROPERTY FOLDER "MantidFramework")
target_link_libraries(
EventParallelLoader
PUBLIC Mantid::Kernel
PRIVATE Boost::serialization
)
if(UNIX AND NOT APPLE)
target_link_libraries(EventParallelLoader PRIVATE rt)
endif()
# Add the unit tests directory
add_subdirectory(test)
# Installation settings
if(CONDA_ENV)
set(TARGET_EXPORT_NAME "MantidParallelTargets")
mtd_install_framework_lib(TARGETS Parallel EXPORT_NAME ${TARGET_EXPORT_NAME})
else()
mtd_install_targets(TARGETS Parallel INSTALL_DIRS ${LIB_DIR} ${WORKBENCH_LIB_DIR})
endif()
mtd_install_targets(TARGETS EventParallelLoader INSTALL_DIRS ${LIB_DIR} ${WORKBENCH_LIB_DIR})