[minhook] fix usage issue (#12399)

* fix minhook lib faild to load when tring to be included in a project

* fix usage issue
This commit is contained in:
JonLiu1993 2020-07-14 01:54:00 +08:00 committed by GitHub
parent 0523b5eb57
commit 4953c8a3c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 31 deletions

View File

@ -1,4 +1,5 @@
Source: minhook
Version: 1.3.3
Port-Version: 1
Description: The Minimalistic x86/x64 API Hooking Library for Windows.
Supports: !uwp

View File

@ -0,0 +1,10 @@
diff --git a/cmake/minhook-config.cmake.in b/cmake/minhook-config.cmake.in
index 14e6463..28fa17c 100644
--- a/cmake/minhook-config.cmake.in
+++ b/cmake/minhook-config.cmake.in
@@ -36,4 +36,4 @@ set(MINHOOK_FOUND ON)
set_and_check(MINHOOK_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/include/")
set_and_check(MINHOOK_LIBRARY_DIRS "${PACKAGE_PREFIX_DIR}/lib")
-include("${PACKAGE_PREFIX_DIR}/lib/minhook/minhook-targets.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/minhook-targets.cmake")

View File

@ -1,22 +0,0 @@
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(

View File

@ -1,8 +1,4 @@
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
message(FATAL_ERROR "${PORT} does not currently support UWP")
endif()
include(vcpkg_common_functions)
vcpkg_fail_port_install(ON_TARGET "UWP")
if (VCPKG_TARGET_ARCHITECTURE MATCHES "x86")
set(BUILD_ARCH "Win32")
@ -30,20 +26,18 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
"${CMAKE_SUPPORT_PATCH}"
install-destination.patch
fix-usage.patch
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/minhook)
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)