]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: update build<lib>.cmake for supporting ninja
authorDeepika Upadhyay <dupadhya@redhat.com>
Tue, 6 Jul 2021 10:18:34 +0000 (10:18 +0000)
committerDeepika Upadhyay <dupadhya@redhat.com>
Tue, 6 Jul 2021 14:22:28 +0000 (14:22 +0000)
* affects cmake builds for: yaml-cpp, thrift, jaeger, opentracing external
projects

changes done:
* artificat BUILD_BYPRODUCT which tells ninja which library will be generated
after the build(needed for dependent build libs)
* use cmake_command if `make` not found so that we use default generator, cmake
will identify and use ninja directly in this case.
* minor reorder of boost path in jaeger build external projet

fixes: https://tracker.ceph.com/issues/51029

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
cmake/modules/BuildJaeger.cmake
cmake/modules/BuildOpenTracing.cmake
cmake/modules/Buildthrift.cmake
cmake/modules/Buildyaml-cpp.cmake

index 6a7d41208ad6fe4292f677e84d9ed80e07528beb..55f9b31aeec0864a48737dcbb59637c54c499191 100644 (file)
@@ -22,9 +22,10 @@ function(build_jaeger)
                        -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE
                        -DOpenTracing_DIR=${CMAKE_SOURCE_DIR}/src/jaegertracing/opentracing-cpp
                        -Dnlohmann_json_DIR=/usr/lib
+                       -DCMAKE_FIND_ROOT_PATH=${CMAKE_BINARY_DIR}/external\;${CMAKE_BINARY_DIR}/boost\;${CMAKE_BINARY_DIR}/boost/include
                        -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/boost\;${CMAKE_BINARY_DIR}/boost/include\;${CMAKE_BINARY_DIR}/external
-                       -DCMAKE_FIND_ROOT_PATH=${CMAKE_BINARY_DIR}/boost\;${CMAKE_BINARY_DIR}/boost/include\;${CMAKE_BINARY_DIR}/external
                        -DCMAKE_INSTALL_LIBDIR=${CMAKE_BINARY_DIR}/external/lib
+                       -DBOOST_INCLUDEDIR=${CMAKE_BINARY_DIR}/boost/include
                        -Dthrift_HOME=${CMAKE_BINARY_DIR}/external
                        -DOpenTracing_HOME=${CMAKE_BINARY_DIR}/external)
 
@@ -44,11 +45,11 @@ function(build_jaeger)
 
   if(CMAKE_MAKE_PROGRAM MATCHES "make")
     # try to inherit command line arguments passed by parent "make" job
-    set(make_cmd $(MAKE))
+    set(make_cmd $(MAKE) Jaeger)
   else()
-    set(make_cmd ${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG> --target Jaeger)
+    set(make_cmd ${CMAKE_COMMAND} --build <BINARY_DIR> --target Jaeger)
   endif()
-  set(install_cmd $(MAKE) install DESTDIR=)
+  set(install_cmd ${CMAKE_MAKE_PROGRAM} install)
 
   include(ExternalProject)
   ExternalProject_Add(Jaeger
@@ -61,5 +62,6 @@ function(build_jaeger)
     BUILD_COMMAND ${make_cmd}
     INSTALL_COMMAND ${install_cmd}
     DEPENDS "${dependencies}"
+    BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/external/lib/libjaegertracing.so
     )
 endfunction()
index d9c716a23c493accdcea359c9c865ff864b1f9e0..405f53006b5342cf2784d663d816c220c8829492 100644 (file)
@@ -15,11 +15,11 @@ function(build_opentracing)
 
   if(CMAKE_MAKE_PROGRAM MATCHES "make")
     # try to inherit command line arguments passed by parent "make" job
-    set(make_cmd $(MAKE) )
+    set(make_cmd $(MAKE) opentracing)
   else()
     set(make_cmd ${CMAKE_COMMAND} --build <BINARY_DIR> --target opentracing)
   endif()
-  set(install_cmd $(MAKE) install DESTDIR=)
+  set(install_cmd ${CMAKE_MAKE_PROGRAM} install)
 
   include(ExternalProject)
   ExternalProject_Add(opentracing
@@ -31,5 +31,6 @@ function(build_opentracing)
     BUILD_IN_SOURCE 1
     BUILD_COMMAND ${make_cmd}
     INSTALL_COMMAND ${install_cmd}
+    BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/external/lib/libopentracing.so
     )
 endfunction()
index 6601b943a16a6161a3f9dae4acbc9ae1f4e35d0d..6d9579a35212c74da959691ae8c6c7f6f0a95627 100644 (file)
@@ -34,12 +34,11 @@ function(build_thrift)
 
   if(CMAKE_MAKE_PROGRAM MATCHES "make")
     # try to inherit command line arguments passed by parent "make" job
-    set(make_cmd $(MAKE))
+    set(make_cmd $(MAKE) thrift)
   else()
     set(make_cmd ${CMAKE_COMMAND} --build <BINARY_DIR> --target thrift)
   endif()
-
-  set(install_cmd $(MAKE) install DESTDIR=)
+  set(install_cmd ${CMAKE_MAKE_PROGRAM} install)
 
   include(ExternalProject)
   ExternalProject_Add(thrift
@@ -50,5 +49,6 @@ function(build_thrift)
     BUILD_COMMAND ${make_cmd}
     INSTALL_COMMAND ${install_cmd}
     DEPENDS ${dependencies}
+    BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/external/lib/libthrift.so
     )
 endfunction()
index f559c4d4dca9d36cc5c2e5b187098ce76901366a..4f2d13677615736fc5cc05f29b0a296101a7c87c 100644 (file)
@@ -14,11 +14,11 @@ function(build_yamlcpp)
 
   if(CMAKE_MAKE_PROGRAM MATCHES "make")
     # try to inherit command line arguments passed by parent "make" job
-    set(make_cmd "$(MAKE)")
+    set(make_cmd $(MAKE) yaml-cpp)
   else()
     set(make_cmd ${CMAKE_COMMAND} --build <BINARY_DIR> --target yaml-cpp)
   endif()
-set(install_cmd $(MAKE) install DESTDIR=)
+  set(install_cmd ${CMAKE_MAKE_PROGRAM} install)
 
   include(ExternalProject)
   ExternalProject_Add(yaml-cpp