Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gflags] Cleanup, fix usage #35188

Merged
merged 6 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions ports/gflags/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,21 @@ vcpkg_cmake_configure(
-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
)

vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/gflags)

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin" "${CURRENT_PACKAGES_DIR}/bin")
if(NOT VCPKG_TARGET_IS_WINDOWS)
vcpkg_fixup_pkgconfig()
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/gflags.pc" "-lgflags" "-lgflags_debug")
endif()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

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_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING.txt")

vcpkg_copy_pdbs()

vcpkg_fixup_pkgconfig()
3 changes: 2 additions & 1 deletion ports/gflags/usage
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
The package gflags provides CMake targets:
gflags provides CMake targets:

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

if(NOT DEFINED GFLAGS_USE_TARGET_NAMESPACE)
# vcpkg legacy
set(GFLAGS_USE_TARGET_NAMESPACE ON)
_find_package(${ARGS})
unset(GFLAGS_USE_TARGET_NAMESPACE)
endif()
_find_package(${ARGS})

foreach(tgt gflags gflags_shared gflags_static)
if (NOT TARGET ${tgt} AND TARGET "gflags::${tgt}")
add_library(${tgt} INTERFACE IMPORTED)
target_link_libraries(${tgt} INTERFACE "gflags::${tgt}")
endif()
endforeach(tgt)
3 changes: 2 additions & 1 deletion ports/gflags/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "gflags",
"version": "2.2.2",
"port-version": 7,
"port-version": 8,
"description": "A C++ library that implements commandline flags processing",
"homepage": "https://github.com/gflags/gflags",
"license": "BSD-3-Clause",
"supports": "!uwp",
"dependencies": [
{
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2926,7 +2926,7 @@
},
"gflags": {
"baseline": "2.2.2",
"port-version": 7
"port-version": 8
},
"ghc-filesystem": {
"baseline": "1.5.14",
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": "606a0a3ad49f6e6276672e230431e6797d56180e",
"version": "2.2.2",
"port-version": 8
},
{
"git-tree": "1c57a920065312afe80b1b8a3595f82005da61ee",
"version": "2.2.2",
Expand Down