From: Tim Serong Date: Tue, 28 Jun 2016 11:51:32 +0000 (+1000) Subject: cmake: Add FCGI_INCLUDE_DIR to include_directories for rgw X-Git-Tag: ses5-milestone5~517^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3cf6c534ff04e781f8f768138a600f59fc89730b;p=ceph.git cmake: Add FCGI_INCLUDE_DIR to include_directories for rgw rgw_fcgi.{cc,h} includes either "fastcgi/fcgiapp.h" or "fcgiapp.h", depending on whether FASTCGI_INCLUDE_DIR is set. That define is set by autotools, but cmake builds work a little differently -- in the cmake case, FCGI_INCLUDE_DIR is set by Findfcgi.cmake, provided it can find the fastcgi headers *somewhere*. This means the cmake build breaks on SUSE distros (and presumably others) which use "fastcgi/fcgiapp.h", because FASTCGI_INCLUDE_DIR isn't set, so it tries to include "fcgiapp.h", and fails. This change adds FCGI_INCLUDE_DIR to the include directories, and tries to #include if FASTCGI_INCLUDE_DIR is not set, which should work for both cmake and autotools builds. (It would probably be cleanest to fix autotools to behave like cmake, then the #ifdef/#else stuff can be dropped, and we could just always include ) Signed-off-by: Tim Serong --- diff --git a/src/rgw/CMakeLists.txt b/src/rgw/CMakeLists.txt index 370aa0ec932..60004eb78f5 100644 --- a/src/rgw/CMakeLists.txt +++ b/src/rgw/CMakeLists.txt @@ -1,3 +1,5 @@ +include_directories(${FCGI_INCLUDE_DIR}) + add_executable(ceph_rgw_jsonparser rgw_jsonparser.cc rgw_common.cc diff --git a/src/rgw/rgw_fcgi.cc b/src/rgw/rgw_fcgi.cc index bbc19d81dda..245d4075613 100644 --- a/src/rgw/rgw_fcgi.cc +++ b/src/rgw/rgw_fcgi.cc @@ -7,7 +7,7 @@ #ifdef FASTCGI_INCLUDE_DIR # include "fastcgi/fcgiapp.h" #else -# include "fcgiapp.h" +# include #endif diff --git a/src/rgw/rgw_fcgi.h b/src/rgw/rgw_fcgi.h index d83e03f5e63..7b906840d97 100644 --- a/src/rgw/rgw_fcgi.h +++ b/src/rgw/rgw_fcgi.h @@ -8,7 +8,7 @@ #ifdef FASTCGI_INCLUDE_DIR # include "fastcgi/fcgiapp.h" #else -# include "fcgiapp.h" +# include #endif #include "rgw_client_io.h"