diff --git a/BH/CMakeLists.txt b/BH/CMakeLists.txt new file mode 100644 index 00000000..09e59660 --- /dev/null +++ b/BH/CMakeLists.txt @@ -0,0 +1,53 @@ +project(BH) + +set(SOURCE_FILES "AsyncDrawBuffer.cpp" + "BH.cpp" + "BitReader.cpp" + "Common.cpp" + "Config.cpp" + "D2Handlers.cpp" + "D2Helpers.cpp" + "D2Intercepts.cpp" + "D2Stubs.cpp" + "D2Version.cpp" + "DllMain.cpp" + "JSONObject.cpp" + "MPQInit.cpp" + "MPQReader.cpp" + "Mustache.cpp" + "Patch.cpp" + "TableReader.cpp" + "Task.cpp") + +set(MODULE_SOURCES "Modules/Module.cpp" + "Modules/ModuleManager.cpp" + "Modules/AutoTele/AutoTele.cpp" + "Modules/Bnet/Bnet.cpp" + "Modules/ChatColor/ChatColor.cpp" + "Modules/Gamefilter/Gamefilter.cpp" + "Modules/Item/Item.cpp" + "Modules/Item/ItemDisplay.cpp" + "Modules/ItemMover/ItemMover.cpp" + "Modules/Maphack/Maphack.cpp" + "Modules/Party/Party.cpp" + "Modules/ScreenInfo/ScreenInfo.cpp" + "Modules/StashExport/StashExport.cpp") + +set(DRAWING_SOURCES "Drawing/Hook.cpp" + "Drawing/Advanced/Checkhook/Checkhook.cpp" + "Drawing/Advanced/Colorhook/Colorhook.cpp" + "Drawing/Advanced/Combohook/Combohook.cpp" + "Drawing/Advanced/Inputhook/Inputhook.cpp" + "Drawing/Advanced/Keyhook/Keyhook.cpp" + "Drawing/Basic/Boxhook/Boxhook.cpp" + "Drawing/Basic/Crosshook/Crosshook.cpp" + "Drawing/Basic/Framehook/Framehook.cpp" + "Drawing/Basic/Linehook/Linehook.cpp" + "Drawing/Basic/Texthook/Texthook.cpp" + "Drawing/Stats/StatsDisplay.cpp" + "Drawing/UI/UI.cpp" + "Drawing/UI/UITab.cpp") + +set(SOURCE_FILES ${SOURCE_FILES} ${MODULE_SOURCES} ${DRAWING_SOURCES}) +add_library(BH ${SOURCE_FILES}) +target_link_libraries(BH ${STORM_LIBRARY} Shlwapi) diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..5de0785c --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.7) +find_library(STORM_LIBRARY NAMES StormLib HINTS "ThirdParty") +add_subdirectory("BH") diff --git a/README.md b/README.md index 9861e4e3..63e71f07 100644 --- a/README.md +++ b/README.md @@ -590,3 +590,9 @@ Which renders as: * Chipped Ruby (L1) **x8** * Flawed Emerald (L1) **x7** + +# Building + +To build with CMake, first install "Visual Studio Build Tools 2017" and a version of CMake>=3.7. Visual Studio Build Tools comes with a "Developer Command Prompt" that sets up the path with the right compilers and build tools. Next, create a build directory within the project root directory and make it the current working directory. Then, run the command `cmake -G"Visual Studio 15 2017" -DCMAKE_BUILD_SHARED_LIBS=TRUE -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE ..` (save this command as a bat script if you like). This will create all necessary build files. Next, run `cmake --build . --config Release` to build the project. + +To enable multi-processor support when buildling, set the CXXFLAGS environment variable with `set CXXFLAGS=/MP` prior to running the cmake command above.