From: Kefu Chai Date: Fri, 19 May 2017 04:46:46 +0000 (+0800) Subject: cmake: check the existence of gperf before using it X-Git-Tag: v12.1.0~10^2~59^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F15164%2Fhead;p=ceph.git cmake: check the existence of gperf before using it Signed-off-by: Kefu Chai --- diff --git a/src/rgw/CMakeLists.txt b/src/rgw/CMakeLists.txt index 53583652acd..591d136ccae 100644 --- a/src/rgw/CMakeLists.txt +++ b/src/rgw/CMakeLists.txt @@ -25,10 +25,14 @@ add_custom_target(civetweb_h "${CMAKE_BINARY_DIR}/src/include/civetweb" COMMENT "keep civetweb.h up-to-date") +find_program(GPERF gperf) +if(NOT GPERF) + message(FATAL_ERROR "Can't find gperf") +endif() function(gperf_generate input output) add_custom_command( OUTPUT ${output} - COMMAND gperf ${input} > ${output} + COMMAND ${GPERF} ${input} > ${output} DEPENDS ${input} COMMENT "Generate ${output}" )