CMakeLists.txt 4.27 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
set(SRC_FILES
    src/CatalogPublish.cpp
    src/CatalogAlgorithmHelper.cpp
    src/CatalogDownloadDataFiles.cpp
    src/CatalogGetDataFiles.cpp
    src/CatalogGetDataSets.cpp
    src/CatalogKeepAlive.cpp
    src/CatalogListInstruments.cpp
    src/CatalogListInvestigationTypes.cpp
    src/CatalogLogin.cpp
    src/CatalogLogout.cpp
    src/CatalogMyDataSearch.cpp
    src/CatalogSearch.cpp
    src/CatalogSearchParam.cpp
    src/GSoap.cpp
    src/ICat3/ICat3GSoapGenerated.cpp
    src/ICat3/ICat3ErrorHandling.cpp
    src/ICat3/ICat3Catalog.cpp
    src/ICat3/ICat3Helper.cpp
    src/ICat4/ICat4GSoapGenerated.cpp
    src/ICat4/ICat4Catalog.cpp)
22

23
set(SRC_UNITY_IGNORE_FILES)
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
set(INC_FILES
    inc/MantidICat/CatalogPublish.h
    inc/MantidICat/CatalogAlgorithmHelper.h
    inc/MantidICat/CatalogDownloadDataFiles.h
    inc/MantidICat/CatalogGetDataFiles.h
    inc/MantidICat/CatalogGetDataSets.h
    inc/MantidICat/CatalogKeepAlive.h
    inc/MantidICat/CatalogListInstruments.h
    inc/MantidICat/CatalogListInvestigationTypes.h
    inc/MantidICat/CatalogLogin.h
    inc/MantidICat/CatalogLogout.h
    inc/MantidICat/CatalogMyDataSearch.h
    inc/MantidICat/CatalogSearch.h
    inc/MantidICat/CatalogSearchParam.h
    inc/MantidICat/GSoap/soapserializersH.h
    inc/MantidICat/GSoap/soapserializersStub.h
    inc/MantidICat/GSoap/stdsoap2.h
    inc/MantidICat/ICat3/GSoapGenerated/ICat3H.h
    inc/MantidICat/ICat3/GSoapGenerated/ICat3ICATPortBindingProxy.h
    inc/MantidICat/ICat3/GSoapGenerated/ICat3Stub.h
    inc/MantidICat/ICat3/ICat3ErrorHandling.h
    inc/MantidICat/ICat3/ICat3Catalog.h
    inc/MantidICat/ICat3/ICat3Helper.h
    inc/MantidICat/ICat4/GSoapGenerated/ICat4H.h
    inc/MantidICat/ICat4/GSoapGenerated/ICat4ICATPortBindingProxy.h
    inc/MantidICat/ICat4/GSoapGenerated/ICat4Stub.h
    inc/MantidICat/ICat4/ICat4Catalog.h)
52

53
54
55
56
57
58
59
60
61
62
set(TEST_FILES
    CatalogDownloadDataFilesTest.h
    CatalogGetDataFilesTest.h
    CatalogGetDataSetsTest.h
    CatalogListInstrumentsTest.h
    CatalogListInvestigationTypesTest.h
    CatalogLoginTest.h
    CatalogMyDataSearchTest.h
    CatalogSearchTest.h
    CompositeCatalogTest.h)
63

64
if(COVERAGE)
65
66
67
68
69
  foreach(loop_var ${SRC_FILES} ${INC_FILES})
    set_property(GLOBAL APPEND
                 PROPERTY COVERAGE_SRCS
                          "${CMAKE_CURRENT_SOURCE_DIR}/${loop_var}")
  endforeach(loop_var)
70
71
endif()

72
73
if(UNITY_BUILD)
  include(UnityBuild)
74
  enable_unity_build(ICat SRC_FILES SRC_UNITY_IGNORE_FILES 10)
75
76
endif(UNITY_BUILD)

77
# Add ssl dependency
78
add_definitions(-DWITH_OPENSSL -DWITH_NONAMESPACES)
79

80
# Add a precompiled header where they are supported
81
enable_precompiled_headers(inc/MantidICat/PrecompiledHeader.h SRC_FILES)
82
# Add the target for this directory
83
add_library(ICat ${SRC_FILES} ${INC_FILES})
Stephen's avatar
Stephen committed
84
85
86
87
88
89
add_library(Mantid::ICat ALIAS ICat)

target_include_directories(ICat PUBLIC
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc>
		$<INSTALL_INTERFACE:include/Mantid>
)
90
# Set the name of the generated library
91
92
93
94
95
set_target_properties(ICat
                      PROPERTIES OUTPUT_NAME
                                 MantidICat
                                 COMPILE_DEFINITIONS
                                 IN_MANTID_ICAT)
96

97
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
98
99
100
101
  set_target_properties(ICat
                        PROPERTIES INSTALL_RPATH
                                   "@loader_path/../Contents/MacOS")
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
102
  set_target_properties(ICat PROPERTIES INSTALL_RPATH "\$ORIGIN/../${LIB_DIR}")
103
endif()
104

105
# Add to the 'Framework' group in VS
106
set_property(TARGET ICat PROPERTY FOLDER "MantidFramework")
107
108


Stephen's avatar
Stephen committed
109
target_link_libraries(ICat PUBLIC Mantid::Kernel Mantid::API Mantid::DataObjects OpenSSL::SSL PRIVATE JsonCPP::jsoncpp )
Stephen's avatar
Stephen committed
110

111

112
# Add the unit tests directory
113
add_subdirectory(test)
114

115
# Auto-generate exports header
Stephen's avatar
Stephen committed
116
117
118
119
120
target_include_directories(ICat PUBLIC
  $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/Framework/ICat>
  $<INSTALL_INTERFACE:include/Mantid>
)
generate_mantid_export_header(ICat True)
121

122
# Installation settings
123
if (CONDA_BUILD)
Stephen's avatar
Stephen committed
124
set(TARGET_EXPORT_NAME "MantidICatTargets")
125
126
127
128
129
130
131
132
mtd_install_framework_lib(TARGETS ICat INSTALL_EXPORT_FILE EXPORT_NAME ${TARGET_EXPORT_NAME})
else()
mtd_install_targets(TARGETS
                    ICat
                    INSTALL_DIRS
                    ${PLUGINS_DIR}
                    ${WORKBENCH_PLUGINS_DIR})
endif()
133