]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: link against FUSE::FUSE
authorKefu Chai <kchai@redhat.com>
Fri, 17 Apr 2020 05:46:21 +0000 (13:46 +0800)
committerNathan Cutler <ncutler@suse.com>
Mon, 27 Apr 2020 11:58:21 +0000 (13:58 +0200)
instead of specifying the include directory and linkage separately

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit b823952d245db4967828033003729a643d8e276f)

Conflicts:
src/CMakeLists.txt
- ceph-fuse target_link_libraries call lacks ${EXTRALIBS} parameter in
  nautilus

cmake/modules/FindFUSE.cmake
src/CMakeLists.txt
src/os/CMakeLists.txt
src/rbd_fuse/CMakeLists.txt
src/tools/CMakeLists.txt

index 58c50cb9808e340bb7a49a51fcebc2cc9e8489d4..73fef22d7b3b73b648c2c5ce4b878e580cda47d4 100644 (file)
@@ -26,3 +26,14 @@ find_package_handle_standard_args(FUSE DEFAULT_MSG
 
 mark_as_advanced(
   FUSE_INCLUDE_DIRS FUSE_LIBRARIES)
+
+if(FUSE_FOUND)
+  if(NOT TARGET FUSE::FUSE)
+    add_library(FUSE::FUSE UNKNOWN IMPORTED)
+    set_target_properties(FUSE::FUSE PROPERTIES
+      INTERFACE_INCLUDE_DIRECTORIES "${FUSE_INCLUDE_DIRS}"
+      IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+      IMPORTED_LOCATION "${FUSE_LIBRARIES}"
+      VERSION "${FUSE_VERSION}")
+  endif()
+endif()
index 28ec9835f851dbae8d2085af5ec29c1708f24f6f..f6a97ba15c426ea5b28ecb9f8f54135c81daef4a 100644 (file)
@@ -509,7 +509,7 @@ add_dependencies(ceph-osd erasure_code_plugins)
 target_link_libraries(ceph-osd osd os global-static common
   ${BLKID_LIBRARIES})
 if(WITH_FUSE)
-  target_link_libraries(ceph-osd ${FUSE_LIBRARIES})
+  target_link_libraries(ceph-osd FUSE::FUSE)
 endif()
 set_target_properties(ceph-osd PROPERTIES
   POSITION_INDEPENDENT_CODE ${EXE_LINKER_USE_PIE}
@@ -663,10 +663,9 @@ if(WITH_FUSE)
     ceph_fuse.cc
     client/fuse_ll.cc)
   add_executable(ceph-fuse ${ceph_fuse_srcs})
-  target_link_libraries(ceph-fuse ${FUSE_LIBRARIES}
+  target_link_libraries(ceph-fuse FUSE::FUSE
     ${GSSAPI_LIBRARIES} client ceph-common global-static)
   set_target_properties(ceph-fuse PROPERTIES
-    COMPILE_FLAGS "-I${FUSE_INCLUDE_DIRS}"
     POSITION_INDEPENDENT_CODE ${EXE_LINKER_USE_PIE})
   install(TARGETS ceph-fuse DESTINATION bin)
   install(PROGRAMS mount.fuse.ceph DESTINATION ${CMAKE_INSTALL_SBINDIR})
index e65d7393f7ae5907898327aa97e5fcef9cab5ed0..bc1d9fec13a3892ca906de44383e0df357dd8a48 100644 (file)
@@ -89,8 +89,7 @@ if(HAVE_LIBAIO)
 endif(HAVE_LIBAIO)
 
 if(WITH_FUSE)
-  target_include_directories(os SYSTEM PRIVATE ${FUSE_INCLUDE_DIRS})
-  target_link_libraries(os ${FUSE_LIBRARIES})
+  target_link_libraries(os FUSE::FUSE)
 endif()
 
 if(HAVE_LIBZFS)
index e0bd3e2497d15eb21ae3341f3ab30863a353d0ca..f83f97a3f7da9c07c89798f39abd38d135d75a8e 100644 (file)
@@ -1,5 +1,5 @@
 add_executable(rbd-fuse
   rbd-fuse.cc)
 target_link_libraries(rbd-fuse
-  ceph-common librbd librados global ${FUSE_LIBRARIES})
+  ceph-common librbd librados global FUSE::FUSE)
 install(TARGETS rbd-fuse DESTINATION bin)
index d31f3d240844abe4d5c9f6ba978d764febb50bfa..678ee66cc2d613fa37724d94ec3ef906d8d839da 100644 (file)
@@ -50,7 +50,7 @@ add_executable(ceph-objectstore-tool
   RadosDump.cc)
 target_link_libraries(ceph-objectstore-tool osd os global Boost::program_options ${CMAKE_DL_LIBS})
 if(WITH_FUSE)
-  target_link_libraries(ceph-objectstore-tool ${FUSE_LIBRARIES})
+  target_link_libraries(ceph-objectstore-tool FUSE::FUSE)
 endif(WITH_FUSE)
 install(TARGETS ceph-objectstore-tool DESTINATION bin)