From: Deepika Upadhyay Date: Thu, 22 Jul 2021 16:05:29 +0000 (+0530) Subject: cmake: reorder find_package_handle_standard_arg for thrift X-Git-Tag: v17.1.0~1302^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4df43cff61d5795c0bf42cf2ae3cf0b6019367e0;p=ceph.git cmake: reorder find_package_handle_standard_arg for thrift * Findthrift: thrift_FOUND fails to set if called before find_package_handle_standard_arg, hence reorder adding thrift::libthrift target after it Signed-off-by: Deepika Upadhyay --- diff --git a/cmake/modules/Findthrift.cmake b/cmake/modules/Findthrift.cmake index 81cdee3bea9c..0929448a2409 100644 --- a/cmake/modules/Findthrift.cmake +++ b/cmake/modules/Findthrift.cmake @@ -17,16 +17,15 @@ find_library( HINTS ${thrift_HOME} ENV thrift_HOME /usr/local /opt/local PATH_SUFFIXES lib lib64) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(thrift DEFAULT_MSG thrift_LIBRARIES + thrift_INCLUDE_DIR) +mark_as_advanced(thrift_LIBRARIES thrift_INCLUDE_DIR) + if(thrift_FOUND AND NOT (TARGET thrift::libthrift)) add_library(thrift::libthrift UNKNOWN IMPORTED) - set_target_properties( thrift::libthrift PROPERTIES IMPORTED_LOCATION ${thrift_LIBRARIES} - INTERFACE_INCLUDE_DIRECTORIES ${thrift_INCLUDE_DIR}) + INTERFACE_INCLUDE_DIRECTORIES ${thrift_INCLUDE_DIR}) endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(thrift DEFAULT_MSG thrift_LIBRARIES - thrift_INCLUDE_DIR) -mark_as_advanced(thrift_LIBRARIES thrift_INCLUDE_DIR)