aboutsummaryrefslogtreecommitdiff
path: root/ports
diff options
context:
space:
mode:
authorbucurb <bobuc@microsoft.com>2021-08-28 00:43:13 +0100
committerGitHub <noreply@github.com>2021-08-27 16:43:13 -0700
commit3582b8a4f0a4b8b145ac3359e98b47624a15f8f5 (patch)
treeb9e4d73031a0637f7364e54c8858405a826bd2c9 /ports
parentc350a3b7129edc3240b7fe40dcda6ebd35e9175d (diff)
downloadvcpkg-3582b8a4f0a4b8b145ac3359e98b47624a15f8f5.tar.gz
vcpkg-3582b8a4f0a4b8b145ac3359e98b47624a15f8f5.zip
[glog] Fixed gflags dependency (#18739)
Diffstat (limited to 'ports')
-rw-r--r--ports/gflags/CONTROL3
-rw-r--r--ports/gflags/portfile.cmake5
-rw-r--r--ports/gflags/usage4
-rw-r--r--ports/gflags/vcpkg-cmake-wrapper.cmake9
4 files changed, 19 insertions, 2 deletions
diff --git a/ports/gflags/CONTROL b/ports/gflags/CONTROL
index f2b930778..fec8eeb0f 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 82f651351..e0d9e1dab 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 000000000..67fb74789
--- /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 000000000..f401356da
--- /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)