diff --git a/ports/gflags/portfile.cmake b/ports/gflags/portfile.cmake index fed9053482a6b7..02cb969e4b1005 100644 --- a/ports/gflags/portfile.cmake +++ b/ports/gflags/portfile.cmake @@ -19,15 +19,14 @@ 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") @@ -35,8 +34,6 @@ 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() diff --git a/ports/gflags/usage b/ports/gflags/usage index 67fb74789b6786..5d86c434ab3f72 100644 --- a/ports/gflags/usage +++ b/ports/gflags/usage @@ -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) diff --git a/ports/gflags/vcpkg-cmake-wrapper.cmake b/ports/gflags/vcpkg-cmake-wrapper.cmake index 55b3fc8dc54aa5..8fbb208b43057c 100644 --- a/ports/gflags/vcpkg-cmake-wrapper.cmake +++ b/ports/gflags/vcpkg-cmake-wrapper.cmake @@ -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) diff --git a/ports/gflags/vcpkg.json b/ports/gflags/vcpkg.json index f39eebb7a3a938..4a63b70a029711 100644 --- a/ports/gflags/vcpkg.json +++ b/ports/gflags/vcpkg.json @@ -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": [ { diff --git a/versions/baseline.json b/versions/baseline.json index 52a018c510a1bc..ee4f0f1be281b0 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2926,7 +2926,7 @@ }, "gflags": { "baseline": "2.2.2", - "port-version": 7 + "port-version": 8 }, "ghc-filesystem": { "baseline": "1.5.14", diff --git a/versions/g-/gflags.json b/versions/g-/gflags.json index e513632c9a7344..81fdd19bf2798d 100644 --- a/versions/g-/gflags.json +++ b/versions/g-/gflags.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "606a0a3ad49f6e6276672e230431e6797d56180e", + "version": "2.2.2", + "port-version": 8 + }, { "git-tree": "1c57a920065312afe80b1b8a3595f82005da61ee", "version": "2.2.2",