diff --git a/.gitignore b/.gitignore index 259148f..8499b38 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,8 @@ *.exe *.out *.app + +# folders +cmake-build-debug/ +cmake-build-release/ +.idea/ \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..c1540fd --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.8) +set(CMAKE_CXX_STANDARD 14) + +include(FetchContent) +project(kiero) + +FetchContent_Declare( + MinHook + GIT_REPOSITORY https://github.com/TsudaKageyu/minhook.git + GIT_TAG master +) +FetchContent_MakeAvailable(MinHook) + +add_library(kiero STATIC kiero.cpp kiero.h) + +target_include_directories(kiero + PRIVATE minhook + PUBLIC ${PROJECT_SOURCE_DIR}) + +target_link_libraries(kiero + PRIVATE minhook) \ No newline at end of file diff --git a/kiero.cpp b/kiero.cpp index 73e87f0..3c7c4a0 100644 --- a/kiero.cpp +++ b/kiero.cpp @@ -31,7 +31,11 @@ #endif #if KIERO_USE_MINHOOK +#ifndef KIERO_EXTERNAL_MINHOOK # include "minhook/include/MinHook.h" +#else +# include +#endif #endif #ifdef _UNICODE diff --git a/kiero.h b/kiero.h index 4aba3d4..5460156 100644 --- a/kiero.h +++ b/kiero.h @@ -5,13 +5,14 @@ #define KIERO_VERSION "1.2.12" -#define KIERO_INCLUDE_D3D9 0 // 1 if you need D3D9 hook -#define KIERO_INCLUDE_D3D10 0 // 1 if you need D3D10 hook -#define KIERO_INCLUDE_D3D11 0 // 1 if you need D3D11 hook -#define KIERO_INCLUDE_D3D12 0 // 1 if you need D3D12 hook -#define KIERO_INCLUDE_OPENGL 0 // 1 if you need OpenGL hook -#define KIERO_INCLUDE_VULKAN 0 // 1 if you need Vulkan hook -#define KIERO_USE_MINHOOK 0 // 1 if you will use kiero::bind function +#define KIERO_INCLUDE_D3D9 0 // 1 if you need D3D9 hook +#define KIERO_INCLUDE_D3D10 0 // 1 if you need D3D10 hook +#define KIERO_INCLUDE_D3D11 0 // 1 if you need D3D11 hook +#define KIERO_INCLUDE_D3D12 0 // 1 if you need D3D12 hook +#define KIERO_INCLUDE_OPENGL 0 // 1 if you need OpenGL hook +#define KIERO_INCLUDE_VULKAN 0 // 1 if you need Vulkan hook +#define KIERO_USE_MINHOOK 0 // 1 if you will use kiero::bind function +#define KIERO_EXTERNAL_MINHOOK 0 // 1 if you are using CMake, or wish to use your own minhook version. #define KIERO_ARCH_X64 0 #define KIERO_ARCH_X86 0