From 3cf6c534ff04e781f8f768138a600f59fc89730b Mon Sep 17 00:00:00 2001 From: Tim Serong Date: Tue, 28 Jun 2016 21:51:32 +1000 Subject: [PATCH] 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 --- src/rgw/CMakeLists.txt | 2 ++ src/rgw/rgw_fcgi.cc | 2 +- src/rgw/rgw_fcgi.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rgw/CMakeLists.txt b/src/rgw/CMakeLists.txt index 370aa0ec93216..60004eb78f584 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 bbc19d81dda3d..245d4075613bb 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 d83e03f5e6372..7b906840d97e9 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" -- 2.39.5