Skip to content

Commit

Permalink
Added CMake support
Browse files Browse the repository at this point in the history
Added CMake support with CMakeLists.txt and CMakePresets.json; updated .gitignore to include build artifacts and CMake files.
  • Loading branch information
chadlrnsn committed Dec 7, 2024
1 parent 61ba701 commit 1a964b0
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -360,4 +360,12 @@ MigrationBackup/
.ionide/

# Fody - auto-generated XML schema
FodyWeavers.xsd
FodyWeavers.xsd

# CMake
CMakeCache.txt
cmake_install.cmake
Makefile

# CMake build directory
build/
38 changes: 38 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
cmake_minimum_required(VERSION 3.15)
project(ImGui_DirectX12_Hook)

# Указываем все исходные файлы
set(SOURCE_FILES
# Основной файл примера DirectX12
ImGui-DirectX-12-Kiero-Hook/vendor/imgui/examples/example_win32_directx12/main.cpp
# Файлы ImGui
ImGui-DirectX-12-Kiero-Hook/vendor/imgui/imgui.cpp
ImGui-DirectX-12-Kiero-Hook/vendor/imgui/imgui_demo.cpp
ImGui-DirectX-12-Kiero-Hook/vendor/imgui/imgui_draw.cpp
ImGui-DirectX-12-Kiero-Hook/vendor/imgui/imgui_tables.cpp
ImGui-DirectX-12-Kiero-Hook/vendor/imgui/imgui_widgets.cpp
ImGui-DirectX-12-Kiero-Hook/vendor/imgui/backends/imgui_impl_dx12.cpp
ImGui-DirectX-12-Kiero-Hook/vendor/imgui/backends/imgui_impl_win32.cpp
)

# Указываем пути для включаемых файлов
include_directories(
ImGui-DirectX-12-Kiero-Hook/vendor/minhook/include
ImGui-DirectX-12-Kiero-Hook/vendor/imgui
ImGui-DirectX-12-Kiero-Hook/vendor/imgui/backends
ImGui-DirectX-12-Kiero-Hook/vendor/imgui/examples/example_win32_directx12
ImGui-DirectX-12-Kiero-Hook/vendor/kiero
)

# Создаем DLL
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})

# Добавляем MinHook
add_subdirectory(ImGui-DirectX-12-Kiero-Hook/vendor/minhook)

# Линкуем необходимые библиотеки
target_link_libraries(${PROJECT_NAME} PRIVATE
minhook
d3d12
dxgi
)
19 changes: 19 additions & 0 deletions CMakePresets.Json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": 3,
"configurePresets": [
{
"name": "windows-x64-debug",
"displayName": "Windows x64 Debug",
"description": "Target Windows with the Visual Studio development environment.",
"generator": "Visual Studio 17 2022",
"architecture": {
"value": "x64",
"strategy": "set"
},
"binaryDir": "${sourceDir}/build/windows-x64-debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
}
]
}

0 comments on commit 1a964b0

Please sign in to comment.