CMakeLists.txt 3.21 KB
Newer Older
1
set(SRC_FILES
Owen Arnold's avatar
Owen Arnold committed
2
    src/H5ForwardCompatibility.cpp
3
4
    src/Hdf5Version.cpp
    src/InstrumentBuilder.cpp
Owen Arnold's avatar
Owen Arnold committed
5
    src/JSONGeometryParser.cpp
Moore's avatar
Moore committed
6
    src/JSONInstrumentBuilder.cpp
7
    src/NexusGeometryParser.cpp
8
    src/NexusGeometrySave.cpp
Owen Arnold's avatar
Owen Arnold committed
9
    src/NexusGeometryUtilities.cpp
10
11
    src/NexusShapeFactory.cpp
    src/TubeBuilder.cpp
Owen Arnold's avatar
Owen Arnold committed
12
    src/TubeHelpers.cpp)
13
14

set(INC_FILES
Owen Arnold's avatar
Owen Arnold committed
15
16
    inc/MantidNexusGeometry/AbstractLogger.h
    inc/MantidNexusGeometry/H5ForwardCompatibility.h
17
18
    inc/MantidNexusGeometry/Hdf5Version.h
    inc/MantidNexusGeometry/InstrumentBuilder.h
Owen Arnold's avatar
Owen Arnold committed
19
    inc/MantidNexusGeometry/JSONGeometryParser.h
Owen Arnold's avatar
Owen Arnold committed
20
    inc/MantidNexusGeometry/JSONInstrumentBuilder.h
Owen Arnold's avatar
Owen Arnold committed
21
    inc/MantidNexusGeometry/NexusGeometryDefinitions.h
22
    inc/MantidNexusGeometry/NexusGeometryParser.h
23
    inc/MantidNexusGeometry/NexusGeometrySave.h
Owen Arnold's avatar
Owen Arnold committed
24
    inc/MantidNexusGeometry/NexusGeometryUtilities.h
25
26
    inc/MantidNexusGeometry/NexusShapeFactory.h
    inc/MantidNexusGeometry/TubeBuilder.h
Owen Arnold's avatar
Owen Arnold committed
27
    inc/MantidNexusGeometry/TubeHelpers.h)
28
29
30

set(TEST_FILES
    InstrumentBuilderTest.h
Moore's avatar
Moore committed
31
    JSONInstrumentBuilderTest.h
32
    NexusGeometryParserTest.h
33
    NexusGeometrySaveTest.h
Moore's avatar
Moore committed
34
    JSONGeometryParserTest.h
35
36
37
38
    NexusShapeFactoryTest.h
    TubeBuilderTest.h
    TubeHelpersTest.h)

39
if(COVERAGE)
40
41
42
43
  foreach(loop_var ${SRC_FILES} ${INC_FILES})
    set_property(GLOBAL APPEND
                 PROPERTY COVERAGE_SRCS
                          "${CMAKE_CURRENT_SOURCE_DIR}/${loop_var}")
44
  endforeach(loop_var)
45
46
endif()

47
# Add the target for this directory
48
add_library(NexusGeometry ${SRC_FILES} ${INC_FILES})
49
50
51
52
53
54
add_library(Mantid::NexusGeometry ALIAS NexusGeometry)

target_include_directories(NexusGeometry PUBLIC
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc>
		$<INSTALL_INTERFACE:include/Mantid>
)
55
# Set the name of the generated library
56
57
58
59
60
set_target_properties(NexusGeometry
                      PROPERTIES OUTPUT_NAME
                                 MantidNexusGeometry
                                 COMPILE_DEFINITIONS
                                 IN_MANTID_NEXUS_GEOMETRY)
61

62
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
63
  set_target_properties(NexusGeometry
64
                        PROPERTIES INSTALL_RPATH "@loader_path/../MacOS;@loader_path/../Frameworks")
65
endif()
66
67

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

70
71
72
73
target_link_libraries(NexusGeometry PUBLIC Mantid::Geometry Mantid::API
                      PRIVATE
                      Mantid::Kernel
                      Mantid::Json
Stephen's avatar
Stephen committed
74
75
76
                      Mantid::Indexing
                      Boost::filesystem
                      )
77
78

# Add the unit tests directory
79
add_subdirectory(test)
Samuel Jackson's avatar
Samuel Jackson committed
80

81
# Auto-generate exports header
Stephen's avatar
Stephen committed
82
83
84
85
86
87
88
89
90
target_include_directories(NexusGeometry PUBLIC
  $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/Framework/NexusGeometry>
  $<INSTALL_INTERFACE:include/Mantid>
)
generate_mantid_export_header(NexusGeometry FALSE)

# Installation settings
set(TARGET_EXPORT_NAME "MantidNexusGeometryTargets")
mtd_install_dylib(TARGETS NexusGeometry INSTALL_EXPORT_FILE EXPORT_NAME ${TARGET_EXPORT_NAME} INSTALL_DIRS ${LIB_DIR} ${WORKBENCH_LIB_DIR})
91

Stephen's avatar
Stephen committed
92
93
94
95
96
install(EXPORT ${TARGET_EXPORT_NAME}
        FILE ${TARGET_EXPORT_NAME}.cmake
        NAMESPACE Mantid::
        DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MantidFramework
)