]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: define mgr_cap_obj library when WITH_MGR=OFF 31326/head
authorCasey Bodley <cbodley@redhat.com>
Fri, 1 Nov 2019 20:04:37 +0000 (16:04 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 1 Nov 2019 20:05:08 +0000 (16:05 -0400)
resolves the cmake error when WITH_MGR=OFF:

  Error evaluating generator expression:

    $<TARGET_OBJECTS:mgr_cap_obj>

  Objects of target "mgr_cap_obj" referenced but no such target exists.
Call Stack (most recent call first):
  src/mon/CMakeLists.txt:34 (add_library)

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/CMakeLists.txt
src/mgr/CMakeLists.txt

index 275a8ebd1746596bfefd646baba4aede2b7e6051..c2a9d7a66920c715dfd90895fa063c4e31961773 100644 (file)
@@ -473,9 +473,7 @@ if(WITH_LIBRADOSSTRIPER)
   add_subdirectory(libradosstriper)
 endif()
 
-if(WITH_MGR)
-  add_subdirectory(mgr)
-endif()
+add_subdirectory(mgr)
 
 set(librados_config_srcs
   librados-config.cc)
index 79227bcc1d46c9d0b2df28bab6674259b6af24b7..e69335eb6976736a8fa91e073551a15482f792de 100644 (file)
@@ -1,39 +1,41 @@
 add_library(mgr_cap_obj OBJECT
   MgrCap.cc)
 
-set(mgr_srcs
-  ${CMAKE_SOURCE_DIR}/src/ceph_mgr.cc
-  ${CMAKE_SOURCE_DIR}/src/mon/PGMap.cc
-  ActivePyModule.cc
-  ActivePyModules.cc
-  BaseMgrModule.cc
-  BaseMgrStandbyModule.cc
-  ClusterState.cc
-  DaemonHealthMetricCollector.cc
-  DaemonKey.cc
-  DaemonServer.cc
-  DaemonState.cc
-  Gil.cc
-  Mgr.cc
-  MgrStandby.cc
-  OSDPerfMetricTypes.cc
-  OSDPerfMetricCollector.cc
-  PyFormatter.cc
-  PyUtil.cc
-  PyModule.cc
-  PyModuleRegistry.cc
-  PyModuleRunner.cc
-  PyOSDMap.cc
-  StandbyPyModules.cc
-  mgr_commands.cc
-  $<TARGET_OBJECTS:mgr_cap_obj>)
-add_executable(ceph-mgr ${mgr_srcs})
-target_include_directories(ceph-mgr SYSTEM PRIVATE "${Python_INCLUDE_DIRS}")
-target_link_libraries(ceph-mgr
-  osdc client heap_profiler
-  global-static ceph-common
-  Boost::python${MGR_PYTHON_VERSION_MAJOR}${MGR_PYTHON_VERSION_MINOR}
-  ${MGR_PYTHON_LIBRARIES} ${CMAKE_DL_LIBS} ${GSSAPI_LIBRARIES})
-set_target_properties(ceph-mgr PROPERTIES
-  POSITION_INDEPENDENT_CODE ${EXE_LINKER_USE_PIE})
-install(TARGETS ceph-mgr DESTINATION bin)
+if(WITH_MGR)
+  set(mgr_srcs
+    ${CMAKE_SOURCE_DIR}/src/ceph_mgr.cc
+    ${CMAKE_SOURCE_DIR}/src/mon/PGMap.cc
+    ActivePyModule.cc
+    ActivePyModules.cc
+    BaseMgrModule.cc
+    BaseMgrStandbyModule.cc
+    ClusterState.cc
+    DaemonHealthMetricCollector.cc
+    DaemonKey.cc
+    DaemonServer.cc
+    DaemonState.cc
+    Gil.cc
+    Mgr.cc
+    MgrStandby.cc
+    OSDPerfMetricTypes.cc
+    OSDPerfMetricCollector.cc
+    PyFormatter.cc
+    PyUtil.cc
+    PyModule.cc
+    PyModuleRegistry.cc
+    PyModuleRunner.cc
+    PyOSDMap.cc
+    StandbyPyModules.cc
+    mgr_commands.cc
+    $<TARGET_OBJECTS:mgr_cap_obj>)
+  add_executable(ceph-mgr ${mgr_srcs})
+  target_include_directories(ceph-mgr SYSTEM PRIVATE "${Python_INCLUDE_DIRS}")
+  target_link_libraries(ceph-mgr
+    osdc client heap_profiler
+    global-static ceph-common
+    Boost::python${MGR_PYTHON_VERSION_MAJOR}${MGR_PYTHON_VERSION_MINOR}
+    ${MGR_PYTHON_LIBRARIES} ${CMAKE_DL_LIBS} ${GSSAPI_LIBRARIES})
+  set_target_properties(ceph-mgr PROPERTIES
+    POSITION_INDEPENDENT_CODE ${EXE_LINKER_USE_PIE})
+  install(TARGETS ceph-mgr DESTINATION bin)
+endif()