[wangle]fix wangle-config.cmake bug (#5653)

This commit is contained in:
JackBoosY 2019-03-14 01:08:42 +08:00 committed by Phil Christensen
parent deae3465bc
commit 842d6169a6
4 changed files with 27 additions and 1 deletions

View File

@ -1,4 +1,4 @@
Source: wangle
Version: 2019.01.07.00
Version: 2019.01.07.00-1
Build-Depends: fizz, folly, openssl, gtest, glog, libevent, double-conversion
Description: Wangle is a framework providing a set of common client/server abstractions for building services in a consistent, modular, and composable way.

View File

@ -0,0 +1,19 @@
diff --git a/wangle/cmake/wangle-config.cmake.in b/wangle/cmake/wangle-config.cmake.in
index e50af54..a16cdbb 100644
--- a/wangle/cmake/wangle-config.cmake.in
+++ b/wangle/cmake/wangle-config.cmake.in
@@ -12,7 +12,13 @@
@PACKAGE_INIT@
set_and_check(WANGLE_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
-set_and_check(WANGLE_CMAKE_DIR "@PACKAGE_CMAKE_INSTALL_DIR@")
+set_and_check(WANGLE_CMAKE_DIR "${PACKAGE_PREFIX_DIR}/share/wangle")
+
+find_package(folly REQUIRED)
+find_package(fizz REQUIRED)
+find_package(glog REQUIRED)
+find_package(threads REQUIRED)
+find_package(libevent REQUIRED)
if (NOT TARGET wangle::wangle)
include("${WANGLE_CMAKE_DIR}/wangle-targets.cmake")

View File

@ -11,6 +11,7 @@ vcpkg_from_github(
PATCHES
build.patch
gflags.patch
fix-config-cmake.patch
)
vcpkg_configure_cmake(
@ -35,3 +36,4 @@ file(REMOVE_RECURSE
# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/wangle RENAME copyright)
file(INSTALL ${CURRENT_PORT_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/wangle)

5
ports/wangle/usage Normal file
View File

@ -0,0 +1,5 @@
The package wangle is compatible with built-in CMake targets:
find_package(wangle REQUIRED)
target_link_libraries(main PRIVATE wangle::wangle)
target_include_directories(main PRIVATE ${WANGLE_INCLUDE_DIR})