From 4dc96e8c57443b6bf95c9d8e913aaafa5811b3c3 Mon Sep 17 00:00:00 2001 From: Lukas Senionis Date: Wed, 15 Jan 2025 21:00:29 +0200 Subject: [PATCH] fix(cmake/windows): static link MinHook (#3537) --- cmake/dependencies/windows.cmake | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cmake/dependencies/windows.cmake b/cmake/dependencies/windows.cmake index 0563e567817..11a40ecf481 100644 --- a/cmake/dependencies/windows.cmake +++ b/cmake/dependencies/windows.cmake @@ -1,4 +1,12 @@ # windows specific dependencies # nlohmann_json -pkg_check_modules(NLOHMANN_JSON nlohmann_json REQUIRED IMPORTED_TARGET) +find_package(nlohmann_json CONFIG 3.11 REQUIRED) + +# Make sure MinHook is installed +find_library(MINHOOK_LIBRARY libMinHook.a REQUIRED) +find_path(MINHOOK_INCLUDE_DIR MinHook.h PATH_SUFFIXES include REQUIRED) + +add_library(minhook::minhook STATIC IMPORTED) +set_property(TARGET minhook::minhook PROPERTY IMPORTED_LOCATION ${MINHOOK_LIBRARY}) +target_include_directories(minhook::minhook INTERFACE ${MINHOOK_INCLUDE_DIR})