cmake: update FUSE_INCLUDE_DIRS to match autoconf

client/fuse_ll.cc is now including <fuse.h> and <fuse_lowlevel.h>
instead of <fuse/fuse.h> and <fuse/fuse_lowlevel.h>, 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 <cbodley@redhat.com>
This commit is contained in:
Casey Bodley 2015-09-01 11:35:42 -04:00
parent 37462359a3
commit 7c00bf05db
2 changed files with 4 additions and 3 deletions

View File

@ -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}")

View File

@ -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)