Skip to content

Commit

Permalink
[glog] Fixed gflags dependency (#18739)
Browse files Browse the repository at this point in the history
  • Loading branch information
bucurb committed Aug 27, 2021
1 parent c350a3b commit 3582b8a
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 4 deletions.
3 changes: 2 additions & 1 deletion ports/gflags/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Source: gflags
Version: 2.2.2-1
Version: 2.2.2
Port-Version: 2
Homepage: https://github.com/gflags/gflags
Description: A C++ library that implements commandline flags processing
Supports: !uwp
5 changes: 4 additions & 1 deletion ports/gflags/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ vcpkg_configure_cmake(
-DGFLAGS_REGISTER_BUILD_DIR:BOOL=OFF
-DGFLAGS_REGISTER_INSTALL_PREFIX:BOOL=OFF
-DBUILD_gflags_nothreads_LIB:BOOL=OFF
-DGFLAGS_USE_TARGET_NAMESPACE:BOOL=ON
-DCMAKE_DEBUG_POSTFIX=d
)

Expand All @@ -33,6 +34,8 @@ endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)

file(INSTALL ${SOURCE_PATH}/COPYING.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/gflags RENAME copyright)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/COPYING.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

vcpkg_copy_pdbs()
4 changes: 4 additions & 0 deletions ports/gflags/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
The package gflags provides CMake targets:

find_package(gflags CONFIG REQUIRED)
target_link_libraries(main PRIVATE gflags::gflags)
9 changes: 9 additions & 0 deletions ports/gflags/vcpkg-cmake-wrapper.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
set(GFLAGS_USE_TARGET_NAMESPACE ON)

_find_package(${ARGS})

foreach(tgt gflags gflags_shared gflags_static)
if (NOT TARGET ${tgt} AND TARGET "gflags::${tgt}")
add_library(${tgt} ALIAS "gflags::${tgt}")
endif()
endforeach(tgt)
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2293,8 +2293,8 @@
"port-version": 0
},
"gflags": {
"baseline": "2.2.2-1",
"port-version": 0
"baseline": "2.2.2",
"port-version": 2
},
"ghc-filesystem": {
"baseline": "1.5.4",
Expand Down
5 changes: 5 additions & 0 deletions versions/g-/gflags.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "1e2bb870b1e3592591d62f396378e25b2678d80c",
"version-string": "2.2.2",
"port-version": 2
},
{
"git-tree": "7dd635d5295af145f4601ba13219aa0d84630f27",
"version-string": "2.2.2-1",
Expand Down

0 comments on commit 3582b8a

Please sign in to comment.