Update CMakeLists.txt and README.md

This commit is contained in:
Daniel S. 2019-12-04 01:21:51 +01:00
parent 1cac557511
commit 9baa3a4630
2 changed files with 9 additions and 10 deletions

View File

@ -5,6 +5,7 @@ project(ScrapHacks
VERSION 1.0
DESCRIPTION "Scrapland memory hacking library"
LANGUAGES CXX)
set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}")
if(WIN32)
@ -31,11 +32,13 @@ ExternalProject_Add(
URL
https://archive.org/download/DirectX.8.0a.SDK_includes_libs_only/DirectX.8.0a.SDK.zip
URL_HASH SHA1=39f168336d0df92ff14d62d5e3aef1b9e3191312)
ExternalProject_Get_Property(DirectX SOURCE_DIR)
include_directories(AFTER ${SOURCE_DIR}/8.0/include/)
link_directories(AFTER ${SOURCE_DIR}/8.0/lib/)
find_package (Python3 3.6 REQUIRED COMPONENTS Interpreter)
find_package(Python3 3.6 REQUIRED COMPONENTS Interpreter)
add_custom_target(
MAKE_D3D8_VMT ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/src/make_D3D8_VMT.py ${CMAKE_CURRENT_SOURCE_DIR}/src/D3D8_VMT.hpp ${SOURCE_DIR}/8.0/include/d3d8.h
@ -88,4 +91,3 @@ target_link_libraries(ScrapHack
# PYTHON15
legacy_stdio_definitions)
target_compile_features(ScrapHack PUBLIC cxx_std_11)
install(TARGETS ScrapHack DESTINATION bin)

View File

@ -6,18 +6,14 @@
## Building
Open VS 32-bit command prompt (`vcvars32.bat`)
Open VS 32-bit command prompt (`vcvars32.bat`) and run the following two commands
```batch
mkdir build
cd build
cmake -G"NMake Makefiles" ..
mkdir bin
cd bin
cmake --build .. --target install
cmake -G"NMake Makefiles" -B build
cmake --build build --target install
```
this will drop the compiled files into `./build/bin`
this will generate `ScrapHack.pyd` files in `./build`
## Usage
@ -25,6 +21,7 @@ this will drop the compiled files into `./build/bin`
- copy `ScrapHack.pyd` into said folder
- open the ingame console (Ctrl+^)
- type `import ScrapHack`
- type `$help`
- Done!
## Notes