]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cmake: use BOOST_ROOT if building with system boost
authorDeepika Upadhyay <dupadhya@redhat.com>
Mon, 7 Feb 2022 13:12:12 +0000 (08:12 -0500)
committerOmri Zeneva <ozeneva@redhat.com>
Tue, 17 May 2022 08:38:01 +0000 (04:38 -0400)
Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
cmake/modules/BuildOpentelemetry.cmake

index c528273a098e18c23ac149abf4258eb479486008..ab28fa622e48ccbf1a64afae8e79110650c2e197 100644 (file)
@@ -12,8 +12,7 @@ function(build_opentelemetry)
   set(opentelemetry_CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON
                                -DWITH_JAEGER=ON
                                -DBUILD_TESTING=OFF
-                               -DWITH_EXAMPLES=OFF
-                              -DBoost_INCLUDE_DIR=${CMAKE_BINARY_DIR}/boost/include)
+                               -DWITH_EXAMPLES=OFF)
 
   set(opentelemetry_libs
       ${opentelemetry_BINARY_DIR}/sdk/src/trace/libopentelemetry_trace.a
@@ -40,8 +39,11 @@ function(build_opentelemetry)
                  ${opentelemetry_cpp_targets})
   endif()
 
-  if(NOT WITH_SYSTEM_BOOST)
+  if(WITH_SYSTEM_BOOST)
+    list(APPEND opentelemetry_CMAKE_ARGS -DBOOST_ROOT=${BOOST_ROOT})
+  else()
     list(APPEND dependencies Boost)
+    list(APPEND opentelemetry_CMAKE_ARGS -DBoost_INCLUDE_DIR=${CMAKE_BINARY_DIR}/boost/include)
   endif()
 
   include(ExternalProject)