Skip to content

Commit 1f63302

Browse files
committed
[Geneva] error out for missing dpes when building as external component
1 parent 4bfaa31 commit 1f63302

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

exporters/fluentd/CMakeLists.txt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,16 @@ set(nlohmann_json_clone FALSE)
4141
if(nlohmann_json_FOUND)
4242
message("Using external nlohmann::json")
4343
else()
44-
include(cmake/nlohmann-json.cmake)
45-
set(nlohmann_json_clone TRUE)
46-
set(nlohmann_json_SOURCE_DIR
47-
"${CMAKE_SOURCE_DIR}/nlohmann_json/single_include")
48-
include_directories(${nlohmann_json_SOURCE_DIR})
49-
message("nlohmann_json package was not found. Cloning from github")
44+
if (MAIN_PROJECT)
45+
include(cmake/nlohmann-json.cmake)
46+
set(nlohmann_json_clone TRUE)
47+
set(nlohmann_json_SOURCE_DIR
48+
"${CMAKE_SOURCE_DIR}/nlohmann_json/single_include")
49+
include_directories(${nlohmann_json_SOURCE_DIR})
50+
message("nlohmann_json package was not found. Cloning from github")
51+
else()
52+
message(FATAL_ERROR "nlohmann_json package was not found which is required for opentelemetry-cpp-fluentd. Please install it")
53+
endif()
5054
endif()
5155

5256
if(MAIN_PROJECT)

0 commit comments

Comments
 (0)