vcpkg/ports/braft/fix-dependency.patch
Gabriel Jorge Menezes 8fc4b4b950
[braft] New port (#23830)
* creating braft port

* format manifest

* version

* Refix

* version

* Add dependency brpc

* version

* Add license

* version

* Fix dependency gflags, fix export include path

* version

* Re-fix dependency

* version

* Re-fix gflags

* version

* Add find_dependency

* version

Co-authored-by: JackBoosY <yuzaiyang@beyondsoft.com>
2022-04-08 15:26:51 -07:00

17 lines
607 B
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 53ddaed..a851c00 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -47,8 +47,9 @@ if ((NOT LEVELDB_INCLUDE_PATH) OR (NOT LEVELDB_LIB))
message(FATAL_ERROR "Fail to find leveldb")
endif()
-find_path(GFLAGS_INCLUDE_PATH NAMES gflags/gflags.h)
-find_library(GFLAGS_LIB NAMES gflags)
+find_package(gflags CONFIG REQUIRED)
+get_target_property(GFLAGS_INCLUDE_PATH gflags::gflags INTERFACE_INCLUDE_DIRECTORIES)
+set(GFLAGS_LIB gflags::gflags)
if ((NOT GFLAGS_INCLUDE_PATH) OR (NOT GFLAGS_LIB))
message(FATAL_ERROR "Fail to find gflags")
endif()