xref: /5.5.2/phosphor/CMakeLists.txt (revision 5c7d9532)
1CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
2PROJECT(phosphor)
3
4INCLUDE(CTest)
5
6IF (${CMAKE_MAJOR_VERSION} GREATER 2)
7    CMAKE_POLICY(SET CMP0042 NEW)
8ENDIF ()
9
10IF(NOT DEFINED COUCHBASE_SERVER_BUILD)
11    INCLUDE(NonServerBuild.cmake)
12ENDIF ()
13
14INCLUDE_DIRECTORIES(BEFORE
15        ${phosphor_SOURCE_DIR}/include
16        ${phosphor_SOURCE_DIR}/src
17        ${phosphor_SOURCE_DIR}/thirdparty/dvyukov/include)
18
19SET(phosphor_HEADER_FILES
20        ${phosphor_SOURCE_DIR}/include/phosphor/category_registry.h
21        ${phosphor_SOURCE_DIR}/include/phosphor/chunk_lock.h
22        ${phosphor_SOURCE_DIR}/include/phosphor/inline_zstring.h
23        ${phosphor_SOURCE_DIR}/include/phosphor/phosphor.h
24        ${phosphor_SOURCE_DIR}/include/phosphor/phosphor-internal.h
25        ${phosphor_SOURCE_DIR}/include/phosphor/relaxed_atomic.h
26        ${phosphor_SOURCE_DIR}/include/phosphor/sentinel.h
27        ${phosphor_SOURCE_DIR}/include/phosphor/stats_callback.h
28        ${phosphor_SOURCE_DIR}/include/phosphor/trace_argument.h
29        ${phosphor_SOURCE_DIR}/include/phosphor/trace_buffer.h
30        ${phosphor_SOURCE_DIR}/include/phosphor/trace_config.h
31        ${phosphor_SOURCE_DIR}/include/phosphor/trace_context.h
32        ${phosphor_SOURCE_DIR}/include/phosphor/trace_event.h
33        ${phosphor_SOURCE_DIR}/include/phosphor/trace_log.h
34        ${phosphor_SOURCE_DIR}/include/phosphor/tracepoint_info.h
35        ${phosphor_SOURCE_DIR}/include/phosphor/platform/core.h
36        ${phosphor_SOURCE_DIR}/include/phosphor/platform/thread.h
37        ${phosphor_SOURCE_DIR}/include/phosphor/platform/visibility.h
38        ${phosphor_SOURCE_DIR}/include/phosphor/tools/export.h)
39
40SET(phosphor_SOURCE_FILES
41        ${phosphor_SOURCE_DIR}/src/category_registry.cc
42        ${phosphor_SOURCE_DIR}/src/chunk_lock.cc
43        ${phosphor_SOURCE_DIR}/src/sentinel.cc
44        ${phosphor_SOURCE_DIR}/src/trace_buffer.cc
45        ${phosphor_SOURCE_DIR}/src/trace_config.cc
46        ${phosphor_SOURCE_DIR}/src/trace_context.cc
47        ${phosphor_SOURCE_DIR}/src/trace_event.cc
48        ${phosphor_SOURCE_DIR}/src/trace_log.cc
49        ${phosphor_SOURCE_DIR}/src/platform/thread.cc
50        ${phosphor_SOURCE_DIR}/src/tools/export.cc
51        ${phosphor_SOURCE_DIR}/src/utils/memory.cc
52        ${phosphor_SOURCE_DIR}/src/utils/string_utils.cc)
53
54ADD_LIBRARY(phosphor SHARED
55        ${phosphor_HEADER_FILES}
56        ${phosphor_SOURCE_FILES})
57
58INSTALL(TARGETS phosphor
59        RUNTIME DESTINATION bin
60        LIBRARY DESTINATION lib
61        ARCHIVE DESTINATION lib)
62
63SET(PHOSPHOR_LIB phosphor)
64GET_DIRECTORY_PROPERTY(hasParent PARENT_DIRECTORY)
65IF(hasParent)
66    SET(PHOSPHOR_LIB phosphor PARENT_SCOPE)
67ENDIF()
68
69ADD_SUBDIRECTORY(tests)
70
71option(PHOSPHOR_BUILD_EXAMPLES "Enable building the examples" OFF)
72IF(PHOSPHOR_BUILD_EXAMPLES)
73    ADD_SUBDIRECTORY(examples)
74ENDIF ()
75
76ENABLE_CODE_COVERAGE_REPORT()
77