summaryrefslogtreecommitdiffstats
path: root/cmake/modules/BuildOpenTracing.cmake
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
commit19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch)
tree42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /cmake/modules/BuildOpenTracing.cmake
parentInitial commit. (diff)
downloadceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.tar.xz
ceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.zip
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmake/modules/BuildOpenTracing.cmake')
-rw-r--r--cmake/modules/BuildOpenTracing.cmake35
1 files changed, 35 insertions, 0 deletions
diff --git a/cmake/modules/BuildOpenTracing.cmake b/cmake/modules/BuildOpenTracing.cmake
new file mode 100644
index 000000000..d9c716a23
--- /dev/null
+++ b/cmake/modules/BuildOpenTracing.cmake
@@ -0,0 +1,35 @@
+function(build_opentracing)
+ set(opentracing_SOURCE_DIR "${CMAKE_SOURCE_DIR}/src/jaegertracing/opentracing-cpp")
+ set(opentracing_BINARY_DIR "${CMAKE_BINARY_DIR}/external/opentracing-cpp")
+
+ set(opentracing_CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON
+ -DBUILD_MOCKTRACER=OFF
+ -DENABLE_LINTING=OFF
+ -DBUILD_STATIC_LIBS=OFF
+ -DBUILD_TESTING=OFF
+ -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/external
+ -DCMAKE_INSTALL_RPATH=${CMAKE_BINARY_DIR}/external
+ -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE
+ -DCMAKE_INSTALL_LIBDIR=${CMAKE_BINARY_DIR}/external/lib
+ -DCMAKE_PREFIX_PATH=${CMAKE_BINARY_DIR}/external)
+
+ if(CMAKE_MAKE_PROGRAM MATCHES "make")
+ # try to inherit command line arguments passed by parent "make" job
+ set(make_cmd $(MAKE) )
+ else()
+ set(make_cmd ${CMAKE_COMMAND} --build <BINARY_DIR> --target opentracing)
+ endif()
+ set(install_cmd $(MAKE) install DESTDIR=)
+
+ include(ExternalProject)
+ ExternalProject_Add(opentracing
+ SOURCE_DIR ${opentracing_SOURCE_DIR}
+ UPDATE_COMMAND ""
+ INSTALL_DIR "external"
+ PREFIX "external/opentracing-cpp"
+ CMAKE_ARGS ${opentracing_CMAKE_ARGS}
+ BUILD_IN_SOURCE 1
+ BUILD_COMMAND ${make_cmd}
+ INSTALL_COMMAND ${install_cmd}
+ )
+endfunction()