CMakeLists.txt 2.46 KB
Newer Older
1
set(SRC_FILES
2
    src/ONCat.cpp
3
4
	src/ONCatEntity.cpp
	src/OAuth.cpp)
5

6
set(INC_FILES
7
8
9
    inc/MantidCatalog/Exception.h
    inc/MantidCatalog/ONCat.h
    inc/MantidCatalog/ONCatEntity.h
10
    inc/MantidCatalog/OAuth.h)
11

12
set(TEST_FILES
13
    ONCatTest.h
14
15
16
	ONCatEntityTest.h
	OAuthTest.h)

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

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

# Add ssl dependency
31
32
include_directories(${OPENSSL_INCLUDE_DIR})
add_definitions(-DWITH_OPENSSL -DWITH_NONAMESPACES)
33
34

# Add the target for this directory
35
add_library(Catalog ${SRC_FILES} ${INC_FILES})
36
37
38
39
40
41
add_library(Mantid::Catalog ALIAS Catalog)

target_include_directories(Catalog PUBLIC
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc>
		$<INSTALL_INTERFACE:include/Mantid>
)
42
# Set the name of the generated library
43
44
45
46
47
set_target_properties(Catalog
                      PROPERTIES OUTPUT_NAME
                                 MantidCatalog
                                 COMPILE_DEFINITIONS
                                 IN_MANTID_CATALOG)
48

49
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
50
  set_target_properties(Catalog
51
                        PROPERTIES INSTALL_RPATH "@loader_path/../MacOS;@loader_path/../Frameworks")
52
53
54
55
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
  set_target_properties(Catalog
                        PROPERTIES INSTALL_RPATH "\$ORIGIN/../${LIB_DIR}")
endif()
56
57

# Add to the 'Framework' group in VS
58
set_property(TARGET Catalog PROPERTY FOLDER "MantidFramework")
59

60
61
target_link_libraries(Catalog PUBLIC Mantid::Kernel PRIVATE ${JSONCPP_LIBRARIES})
target_include_directories(Catalog PRIVATE ${JSONCPP_INCLUDE_DIR})
62
63

# Add the unit tests directory
64
add_subdirectory(test)
65

66
# Auto-generate exports header
Stephen's avatar
Stephen committed
67
68
69
70
target_include_directories(Catalog PUBLIC
  $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/Framework/Catalog>
  $<INSTALL_INTERFACE:include/Mantid>
)
71
generate_mantid_export_header(Catalog TRUE)
72

73
# Installation settings
Stephen's avatar
Stephen committed
74
75
76
77
78
79
80
81
set(TARGET_EXPORT_NAME "MantidCatalogTargets")
mtd_install_dylib(TARGETS Catalog INSTALL_EXPORT_FILE EXPORT_NAME ${TARGET_EXPORT_NAME} INSTALL_DIRS ${LIB_DIR} ${WORKBENCH_LIB_DIR})

install(EXPORT ${TARGET_EXPORT_NAME}
        FILE ${TARGET_EXPORT_NAME}.cmake
        NAMESPACE Mantid::
        DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MantidFramework
)