forked from open-telemetry/opentelemetry-cpp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
49 lines (38 loc) · 1.1 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
cmake_minimum_required(VERSION 3.1)
# See https://cmake.org/cmake/help/v3.3/policy/CMP0057.html required by certain
# versions of gtest
cmake_policy(SET CMP0057 NEW)
project(opentelemetry-cpp)
set(CMAKE_CXX_STANDARD 11)
option(WITH_OTPROTOCOL
"Whether to include the OpenTelemetry Protocol in the SDK" OFF)
set(WITH_PROTOBUF OFF)
if(WITH_OTPROTOCOL)
set(WITH_PROTOBUF ON)
endif()
include(CTest)
find_package(Threads)
if(WITH_PROTOBUF)
set(protobuf_MODULE_COMPATIBLE ON)
find_package(Protobuf CONFIG NAMES protobuf)
# Older versions of protobuf don't use cmake config files.
if(NOT protobuf_FOUND)
find_package(Protobuf REQUIRED)
endif()
endif()
if(WITH_OTPROTOCOL)
include(third_party/opentelemetry-proto/Protobuf.cmake)
endif()
if(BUILD_TESTING)
find_package(GTest REQUIRED)
find_package(benchmark REQUIRED)
include_directories(SYSTEM ${GTEST_INCLUDE_DIRS})
endif()
include_directories(api/include)
add_subdirectory(api)
include_directories(sdk/include)
include_directories(sdk)
add_subdirectory(sdk)
include_directories(.)
add_subdirectory(exporters)
add_subdirectory(examples)