Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support for CMake build system #43

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@
*.exe
*.out
*.app

# folders
cmake-build-debug/
cmake-build-release/
.idea/
21 changes: 21 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
4 changes: 4 additions & 0 deletions kiero.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@
#endif

#if KIERO_USE_MINHOOK
#ifndef KIERO_EXTERNAL_MINHOOK
# include "minhook/include/MinHook.h"
#else
# include <MinHook.h>
#endif
#endif

#ifdef _UNICODE
Expand Down
15 changes: 8 additions & 7 deletions kiero.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down