From: Casey Bodley Date: Tue, 1 Sep 2015 15:35:42 +0000 (-0400) Subject: cmake: update FUSE_INCLUDE_DIRS to match autoconf X-Git-Tag: v9.1.0~227^2^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7c00bf05db08c4fbe77be5286b330c2da7dab779;p=ceph.git cmake: update FUSE_INCLUDE_DIRS to match autoconf client/fuse_ll.cc is now including and instead of and , so we need to add the fuse directory to the FUSE_INCLUDE_DIRS variable using find_path() with just fuse.h was finding a /usr/include/fuse.h instead of the one in /usr/include/fuse/. looking for fuse_common.h and fuse_lowlevel.h first causes it to generate the correct FUSE_INCLUDE_DIRS=/usr/include/fuse Fixes: #12909 Signed-off-by: Casey Bodley --- diff --git a/cmake/modules/Findfuse.cmake b/cmake/modules/Findfuse.cmake index 7c1a8789b28e..dd8a6c17faef 100644 --- a/cmake/modules/Findfuse.cmake +++ b/cmake/modules/Findfuse.cmake @@ -73,7 +73,7 @@ endif(PKG_CONFIG_FOUND) find_path( FUSE_INCLUDE_DIRS - NAMES fuse.h + NAMES fuse_common.h fuse_lowlevel.h fuse.h PATHS "${PC_FUSE_INCLUDE_DIRS}" DOC "Include directories for FUSE" ) @@ -94,8 +94,8 @@ if(NOT FUSE_LIBRARIES) endif(NOT FUSE_LIBRARIES) if(FUSE_FOUND) - if(EXISTS "${FUSE_INCLUDE_DIRS}/fuse/fuse_common.h") - file(READ "${FUSE_INCLUDE_DIRS}/fuse/fuse_common.h" _contents) + if(EXISTS "${FUSE_INCLUDE_DIRS}/fuse_common.h") + file(READ "${FUSE_INCLUDE_DIRS}/fuse_common.h" _contents) string(REGEX REPLACE ".*# *define *FUSE_MAJOR_VERSION *([0-9]+).*" "\\1" FUSE_MAJOR_VERSION "${_contents}") string(REGEX REPLACE ".*# *define *FUSE_MINOR_VERSION *([0-9]+).*" "\\1" FUSE_MINOR_VERSION "${_contents}") set(FUSE_VERSION "${FUSE_MAJOR_VERSION}.${FUSE_MINOR_VERSION}") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5b8298e13083..eed321004c53 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -806,6 +806,7 @@ if(WITH_LIBCEPHFS) client/fuse_ll.cc) add_executable(ceph-fuse ${ceph_fuse_srcs}) target_link_libraries(ceph-fuse fuse client global) + set_target_properties(ceph-fuse PROPERTIES COMPILE_FLAGS "-I${FUSE_INCLUDE_DIRS}") install(TARGETS ceph-fuse DESTINATION bin) endif(WITH_FUSE) endif(WITH_LIBCEPHFS)