CMakeLists.txt 2.39 KB
Newer Older
1
2
set(SRC_FILES
    src/ComponentInfo.cpp
3
	src/DetectorInfo.cpp
4
5
6
7
8
9
10
11
12
13
	src/SpectrumInfo.cpp)

set(INC_FILES
    inc/MantidBeamline/ComponentInfo.h
    inc/MantidBeamline/ComponentType.h
    inc/MantidBeamline/DetectorInfo.h
    inc/MantidBeamline/SpectrumInfo.h)

set(TEST_FILES
    ComponentInfoTest.h
14
	DetectorInfoTest.h
15
	SpectrumInfoTest.h)
16

17
if(COVERAGE)
18
19
20
21
  foreach(loop_var ${SRC_FILES} ${INC_FILES})
    set_property(GLOBAL APPEND
                 PROPERTY COVERAGE_SRCS
                          "${CMAKE_CURRENT_SOURCE_DIR}/${loop_var}")
22
23
24
25
26
27
28
29
30
  endforeach(loop_var)
endif()

if(UNITY_BUILD)
  include(UnityBuild)
  enable_unity_build(Beamline SRC_FILES SRC_UNITY_IGNORE_FILES 10)
endif(UNITY_BUILD)

# Add the target for this directory
31
add_library(Beamline ${SRC_FILES} ${INC_FILES})
32
add_library(Mantid::Beamline ALIAS Beamline)
33
# Set the name of the generated library
34
35
36
37
38
set_target_properties(Beamline
                      PROPERTIES OUTPUT_NAME
                                 MantidBeamline
                                 COMPILE_DEFINITIONS
                                 IN_MANTID_BEAMLINE)
39
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
40
  set_target_properties(Beamline
41
                        PROPERTIES INSTALL_RPATH "@loader_path/../MacOS;@loader_path/../Frameworks")
42
43
44
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
  set_target_properties(Beamline
                        PROPERTIES INSTALL_RPATH "\$ORIGIN/../${LIB_DIR}")
45
endif()
46

47
48
49
50
target_include_directories(Beamline PUBLIC
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc>
		$<INSTALL_INTERFACE:include/Mantid>
)
51
# Add to the 'Framework' group in VS
52
set_property(TARGET Beamline PROPERTY FOLDER "MantidFramework")
53

54
target_link_libraries(Beamline
55
                      PUBLIC
56
                      Eigen3::Eigen
57
                      Mantid::Kernel)
58
59

# Add the unit tests directory
60
add_subdirectory(test)
61

62
# Auto-generate exports header
Stephen's avatar
Stephen committed
63
64
65
66
target_include_directories(Beamline PUBLIC
  $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/Framework/Beamline>
  $<INSTALL_INTERFACE:include/Mantid>
)
67
generate_mantid_export_header(Beamline FALSE)
68

69
# Installation settings
70
if (CONDA_BUILD)
Stephen's avatar
Stephen committed
71
set(TARGET_EXPORT_NAME "MantidBeamlineTargets")
72
73
74
75
76
77
78
79
mtd_install_framework_lib(TARGETS Beamline INSTALL_EXPORT_FILE EXPORT_NAME ${TARGET_EXPORT_NAME})
else()
mtd_install_targets(TARGETS
                    Beamline
                    INSTALL_DIRS
                    ${LIB_DIR}
                    ${WORKBENCH_LIB_DIR})
endif()