GleeBug/CMakeLists.txt

202 lines
5.3 KiB
CMake

# This file is automatically generated from cmake.toml - DO NOT EDIT
# See https://github.com/build-cpp/cmkr for more information
cmake_minimum_required(VERSION 3.15)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "In-tree builds are not supported. Run CMake from a separate directory: cmake -B build")
endif()
set(CMKR_ROOT_PROJECT OFF)
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(CMKR_ROOT_PROJECT ON)
# Bootstrap cmkr and automatically regenerate CMakeLists.txt
include(cmkr.cmake OPTIONAL RESULT_VARIABLE CMKR_INCLUDE_RESULT)
if(CMKR_INCLUDE_RESULT)
cmkr()
endif()
# Enable folder support
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Create a configure-time dependency on cmake.toml to improve IDE support
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS cmake.toml)
endif()
# Options
option(GLEEBUG_RESOURCES "" ON)
project(GleeBug
LANGUAGES
C
CXX
)
# Target: GleeBug
set(GleeBug_SOURCES
"GleeBug/Debugger.Breakpoint.h"
"GleeBug/Debugger.Dll.cpp"
"GleeBug/Debugger.Dll.h"
"GleeBug/Debugger.Global.h"
"GleeBug/Debugger.Loop.DebugString.cpp"
"GleeBug/Debugger.Loop.Dll.cpp"
"GleeBug/Debugger.Loop.Exception.cpp"
"GleeBug/Debugger.Loop.Process.cpp"
"GleeBug/Debugger.Loop.Rip.cpp"
"GleeBug/Debugger.Loop.Thread.cpp"
"GleeBug/Debugger.Loop.Unknown.cpp"
"GleeBug/Debugger.Loop.cpp"
"GleeBug/Debugger.NativeAttach.h"
"GleeBug/Debugger.Process.Breakpoint.cpp"
"GleeBug/Debugger.Process.Memory.cpp"
"GleeBug/Debugger.Process.cpp"
"GleeBug/Debugger.Process.h"
"GleeBug/Debugger.Thread.HardwareBreakpoint.cpp"
"GleeBug/Debugger.Thread.Registers.Flag.h"
"GleeBug/Debugger.Thread.Registers.GetSet.cpp"
"GleeBug/Debugger.Thread.Registers.Register.h"
"GleeBug/Debugger.Thread.Registers.cpp"
"GleeBug/Debugger.Thread.Registers.h"
"GleeBug/Debugger.Thread.cpp"
"GleeBug/Debugger.Thread.h"
"GleeBug/Debugger.cpp"
"GleeBug/Debugger.h"
"GleeBug/GleeBug.h"
"GleeBug/Static.BufferFile.cpp"
"GleeBug/Static.BufferFile.h"
"GleeBug/Static.File.cpp"
"GleeBug/Static.File.h"
"GleeBug/Static.Global.h"
"GleeBug/Static.Pattern.cpp"
"GleeBug/Static.Pattern.h"
"GleeBug/Static.Pe.Section.h"
"GleeBug/Static.Pe.cpp"
"GleeBug/Static.Pe.h"
"GleeBug/Static.Region.h"
"GleeBug/Zydis/Zydis.c"
"GleeBug/Zydis/Zydis.h"
"GleeBug/ntdll.h"
"GleeBug/oprintf.h"
"GleeBug/stringutils.cpp"
"GleeBug/stringutils.h"
cmake.toml
)
add_library(GleeBug STATIC)
target_sources(GleeBug PRIVATE ${GleeBug_SOURCES})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${GleeBug_SOURCES})
target_compile_definitions(GleeBug PUBLIC
NOMINMAX
)
target_compile_features(GleeBug PUBLIC
cxx_std_23
)
target_include_directories(GleeBug PUBLIC
.
)
if(CMAKE_SIZEOF_VOID_P EQUAL 8) # x64
target_link_libraries(GleeBug PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}/GleeBug/ntdll_x64.lib"
)
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 4) # x32
target_link_libraries(GleeBug PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}/GleeBug/ntdll_x86.lib"
)
endif()
# Target: MyDebugger
if(CMKR_ROOT_PROJECT) # root
set(MyDebugger_SOURCES
"MyDebugger/MyDebugger.h"
"MyDebugger/PeTests.h"
"MyDebugger/main.cpp"
cmake.toml
)
add_executable(MyDebugger)
target_sources(MyDebugger PRIVATE ${MyDebugger_SOURCES})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${MyDebugger_SOURCES})
if(NOT TARGET GleeBug)
message(FATAL_ERROR "Target \"GleeBug\" referenced by \"MyDebugger\" does not exist!")
endif()
target_link_libraries(MyDebugger PRIVATE
GleeBug
)
get_directory_property(CMKR_VS_STARTUP_PROJECT DIRECTORY ${PROJECT_SOURCE_DIR} DEFINITION VS_STARTUP_PROJECT)
if(NOT CMKR_VS_STARTUP_PROJECT)
set_property(DIRECTORY ${PROJECT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT MyDebugger)
endif()
endif()
# Target: GleeBugStaticEngine
set(GleeBugStaticEngine_SOURCES
"StaticEngine/Emulator.h"
"StaticEngine/FileMap.h"
"StaticEngine/TitanEngine.h"
"StaticEngine/TitanEngineEmulator.cpp"
"StaticEngine/ntdll.h"
cmake.toml
)
add_library(GleeBugStaticEngine SHARED)
target_sources(GleeBugStaticEngine PRIVATE ${GleeBugStaticEngine_SOURCES})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${GleeBugStaticEngine_SOURCES})
if(NOT TARGET GleeBug)
message(FATAL_ERROR "Target \"GleeBug\" referenced by \"GleeBugStaticEngine\" does not exist!")
endif()
target_link_libraries(GleeBugStaticEngine PRIVATE
GleeBug
)
# Target: GleeBugTitanEngine
set(GleeBugTitanEngine_SOURCES
"TitanEngineEmulator/Emulator.h"
"TitanEngineEmulator/FileMap.h"
"TitanEngineEmulator/Global.Engine.Context.cpp"
"TitanEngineEmulator/Global.Engine.Context.h"
"TitanEngineEmulator/Hider.h"
"TitanEngineEmulator/PEB.h"
"TitanEngineEmulator/TitanEngine.h"
"TitanEngineEmulator/TitanEngineEmulator.cpp"
"TitanEngineEmulator/ntdll.h"
"TitanEngineEmulator/resource.h"
cmake.toml
)
if(GLEEBUG_RESOURCES) # GLEEBUG_RESOURCES
list(APPEND GleeBugTitanEngine_SOURCES
"TitanEngineEmulator/TitanEngine.rc"
)
endif()
add_library(GleeBugTitanEngine SHARED)
target_sources(GleeBugTitanEngine PRIVATE ${GleeBugTitanEngine_SOURCES})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${GleeBugTitanEngine_SOURCES})
if(NOT TARGET GleeBug)
message(FATAL_ERROR "Target \"GleeBug\" referenced by \"GleeBugTitanEngine\" does not exist!")
endif()
target_link_libraries(GleeBugTitanEngine PRIVATE
GleeBug
)
set(CMKR_TARGET GleeBugTitanEngine)
include(output-folders.cmake)