From 3582b8a4f0a4b8b145ac3359e98b47624a15f8f5 Mon Sep 17 00:00:00 2001 From: bucurb Date: Sat, 28 Aug 2021 00:43:13 +0100 Subject: [PATCH] [glog] Fixed gflags dependency (#18739) --- ports/gflags/CONTROL | 3 ++- ports/gflags/portfile.cmake | 5 ++++- ports/gflags/usage | 4 ++++ ports/gflags/vcpkg-cmake-wrapper.cmake | 9 +++++++++ versions/baseline.json | 4 ++-- versions/g-/gflags.json | 5 +++++ 6 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 ports/gflags/usage create mode 100644 ports/gflags/vcpkg-cmake-wrapper.cmake diff --git a/ports/gflags/CONTROL b/ports/gflags/CONTROL index f2b9307789..fec8eeb0ff 100644 --- a/ports/gflags/CONTROL +++ b/ports/gflags/CONTROL @@ -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 \ No newline at end of file diff --git a/ports/gflags/portfile.cmake b/ports/gflags/portfile.cmake index 82f651351f..e0d9e1dab0 100644 --- a/ports/gflags/portfile.cmake +++ b/ports/gflags/portfile.cmake @@ -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 ) @@ -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() diff --git a/ports/gflags/usage b/ports/gflags/usage new file mode 100644 index 0000000000..67fb74789b --- /dev/null +++ b/ports/gflags/usage @@ -0,0 +1,4 @@ +The package gflags provides CMake targets: + + 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 new file mode 100644 index 0000000000..f401356da3 --- /dev/null +++ b/ports/gflags/vcpkg-cmake-wrapper.cmake @@ -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) diff --git a/versions/baseline.json b/versions/baseline.json index e372c7d6ff..50aab092ca 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -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", diff --git a/versions/g-/gflags.json b/versions/g-/gflags.json index 93fbb9bf9d..aa9065db09 100644 --- a/versions/g-/gflags.json +++ b/versions/g-/gflags.json @@ -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",