Skip to content

Commit

Permalink
Apply vcpkg patches in tree
Browse files Browse the repository at this point in the history
  • Loading branch information
stevemk14ebr committed Jun 3, 2024
1 parent 796de83 commit 8cd6cb4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ if (POLYHOOK_USE_EXTERNAL_ZYDIS)
target_link_libraries(${PROJECT_NAME} PUBLIC ${ZYCORE_LIBRARY})
target_include_directories(${PROJECT_NAME} PUBLIC ${ZYDIS_INCLUDE_DIR})
target_include_directories(${PROJECT_NAME} PUBLIC ${ZYCORE_INCLUDE_DIR})
find_package(zydis REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC Zydis::Zydis)
else()
target_link_libraries(${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:Zydis>)
target_include_directories(${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/zydis/include>)
Expand All @@ -233,6 +235,8 @@ function(link_asmjit)
find_path(ASMJIT_INCLUDE_DIR NAMES asmjit/asmjit.h)
target_link_libraries(${PROJECT_NAME} PRIVATE ${ASMJIT_LIBRARY})
target_include_directories(${PROJECT_NAME} PUBLIC ${ASMJIT_INCLUDE_DIR})
find_package(asmjit REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE asmjit::asmjit)
else()
target_link_libraries(${PROJECT_NAME} PRIVATE $<BUILD_INTERFACE:asmjit>)
target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${ASMJIT_SRC}>")
Expand All @@ -248,6 +252,8 @@ if(POLYHOOK_FEATURE_DETOURS)
find_path(ASMTK_INCLUDE_DIR NAMES asmtk/asmtk.h)
target_link_libraries(${PROJECT_NAME} PUBLIC ${ASMTK_LIBRARY})
target_include_directories(${PROJECT_NAME} PUBLIC ${ASMTK_INCLUDE_DIR})
find_package(asmtk REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE asmjit::asmtk)
else()
target_link_libraries(${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:asmtk>)
target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${ASMTK_SRC}>")
Expand Down
9 changes: 9 additions & 0 deletions polyhook_2-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,14 @@ set(POLYHOOK_FEATURE_INLINENTD @POLYHOOK_FEATURE_INLINENTD@)
set(POLYHOOK_FEATURE_PE @POLYHOOK_FEATURE_PE@)
set(POLYHOOK_FEATURE_VIRTUALS @POLYHOOK_FEATURE_VIRTUALS@)

include(CMakeFindDependencyMacro)
find_dependency(Zydis)
if(POLYHOOK_FEATURE_DETOURS)
find_dependency(asmjit)
endif()
if(POLYHOOK_FEATURE_INLINENTD)
find_dependency(asmtk)
endif()

get_filename_component(POLYHOOK_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
include("${POLYHOOK_CMAKE_DIR}/PolyHook_2-targets.cmake")

0 comments on commit 8cd6cb4

Please sign in to comment.