mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-14 06:22:56 +08:00
[minhook] Add new port (#6333)
* [minhook] Add new port * Download cmake support as patch * Move architecture check to before work is done * Check in install destination patchl Remove config
This commit is contained in:
parent
6bbecf3788
commit
5121e7149e
3
ports/minhook/CONTROL
Normal file
3
ports/minhook/CONTROL
Normal file
@ -0,0 +1,3 @@
|
||||
Source: minhook
|
||||
Version: 1.3.3
|
||||
Description: The Minimalistic x86/x64 API Hooking Library for Windows.
|
22
ports/minhook/install-destination.patch
Normal file
22
ports/minhook/install-destination.patch
Normal file
@ -0,0 +1,22 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index df947af..6a894d8 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -113,7 +113,7 @@ install(
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/minhook-config.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/minhook-config-version.cmake"
|
||||
DESTINATION
|
||||
- "lib/minhook"
|
||||
+ share/minhook
|
||||
)
|
||||
|
||||
###################
|
||||
@@ -133,7 +133,7 @@ install(
|
||||
NAMESPACE
|
||||
minhook::
|
||||
DESTINATION
|
||||
- "lib/minhook"
|
||||
+ share/minhook
|
||||
)
|
||||
|
||||
install(
|
49
ports/minhook/portfile.cmake
Normal file
49
ports/minhook/portfile.cmake
Normal file
@ -0,0 +1,49 @@
|
||||
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
message(FATAL_ERROR "${PORT} does not currently support UWP")
|
||||
endif()
|
||||
|
||||
include(vcpkg_common_functions)
|
||||
|
||||
if (VCPKG_TARGET_ARCHITECTURE MATCHES "x86")
|
||||
set(BUILD_ARCH "Win32")
|
||||
set(OUTPUT_DIR "Win32")
|
||||
elseif (VCPKG_TARGET_ARCHITECTURE MATCHES "x64")
|
||||
set(BUILD_ARCH "x64")
|
||||
set(OUTPUT_DIR "Win64")
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported architecture: ${VCPKG_TARGET_ARCHITECTURE}")
|
||||
endif()
|
||||
|
||||
# Download files to enable CMake support for minhook - Adds CMakeLists.txt and minhook-config.cmake.in
|
||||
vcpkg_download_distfile(
|
||||
CMAKE_SUPPORT_PATCH
|
||||
URLS https://github.com/TsudaKageyu/minhook/commit/3f2e34976c1685ee372a09f54c0c8c8f4240ef90.patch
|
||||
FILENAME minhook-cmake-support.patch
|
||||
SHA512 5f353b167e2c31e5e06258420c78fbae0095368cf687ff06a350d6b69b30476824785dde5dbcea3e30ff827e7cdb293727a73e6b1e6875f00aa891b2980c3877
|
||||
)
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO TsudaKageyu/minhook
|
||||
REF v1.3.3
|
||||
SHA512 9f10c92a926a06cde1e4092b664a3aab00477e8b9f20cee54e1d2b3747fad91043d199a2753f7e083497816bbefc5d75d9162d2098dd044420dbca555e80b060
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
"${CMAKE_SUPPORT_PATCH}"
|
||||
install-destination.patch
|
||||
)
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
file(COPY ${CURRENT_PACKAGES_DIR}/debug/share/${PORT}/minhook-targets-debug.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
Loading…
x
Reference in New Issue
Block a user