]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: reorder find_package_handle_standard_arg for thrift
authorDeepika Upadhyay <dupadhya@redhat.com>
Thu, 22 Jul 2021 16:05:29 +0000 (21:35 +0530)
committerDeepika Upadhyay <dupadhya@redhat.com>
Thu, 22 Jul 2021 16:05:29 +0000 (21:35 +0530)
* 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 <dupadhya@redhat.com>
cmake/modules/Findthrift.cmake

index 81cdee3bea9cdbf200394df8f92de7cc98eb91c9..0929448a2409eee6bc09bcba40009e6ededb3ce0 100644 (file)
@@ -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)