diff --git a/README.md b/README.md index eb33722..dd4288a 100644 --- a/README.md +++ b/README.md @@ -18,15 +18,17 @@ Download the DLL from the latest release on the [releases page](https://git.the- ## Build from source (not recommended) -Building is a tad messy atm. I despise Visual Studio and like to manage my own build process. I prefer something simple like a script to build and that's currently what I have, but it's not nearly as clean as I'd like. I hope to fix this mess in the future. +I despise Visual Studio and like to manage my own build process. I prefer something simple like a script to build and that's currently what I have. 1. You'll need git bash and an installation of MSVC (likely via downloading/installing Visual Studio and then installing the C++ build tools). 2. Get the source code. `git clone --recurse-submodules https://git.the-embedded-lab.com/shamilton/LivePlotter.git` -3. Build the glfw library. `cd ext/glfw`. `mkdir build && cd build && cmake ..`. Open GLFW.sln and build the solution. -4. Find `vcvars64.bat` in your installation and modify the path in [run_before_build.bat](./run_before_build.bat) to point to it. -5. Open git bash to the root directory of the project. -6. Run `./run_before_build.bat` then `build.sh` +3. Build the glfw library. `cd ext/glfw`. `mkdir build && cd build && cmake ..`. Open GLFW.sln, Change the configuration to "Release, and build the solution. +4. Find `vcvars64.bat` in your installation and modify the path in [activate.bat](./activate.bat) to point to it. +5. Open cmd.exe to the root directory of the project +6. Run `activate`. Then `build release`. 7. A folder bin/ should exist with `LivePlotter.dll` inside. -8. Copy the entire contents of the bin folder (preferably minus the intermediate build files... sorry) to your project's build output directory +8. Copy the entire contents of the bin folder to your project's build output directory If issues arise, please feel free to create an issue on this repository. + +See the csharp and cpp [example projects](./examples) for details on how to integrate the DLL with your codebase. You must have the project built to run the csharp project (it copies the contents of bin into its output directory). diff --git a/build.bat b/build.bat index 8b99014..a1a562f 100644 --- a/build.bat +++ b/build.bat @@ -1,10 +1,12 @@ @ECHO off SET flags=-Od -ZI -MDd +SET config=Debug IF "%1" == "release" ( - SET flags=-O2 -MTd + SET flags=-O2 -MD -LD + SET config=Release ) SET srcs=src\* mkdir bin obj -cl %srcs% ext\glfw\build\src\Debug\glfw3.lib kernel32.lib user32.lib Gdi32.lib Shell32.lib -I inc -I ext\glm -I ext\glfw\include %flags% -std:c++20 -MP -LD -Fo:obj\\ -Fe:bin\\LivePlotter.dll +cl %srcs% ext\glfw\build\src\%config%\glfw3.lib kernel32.lib user32.lib Gdi32.lib Shell32.lib -I inc -I ext\glm -I ext\glfw\include %flags% -std:c++20 -MP -Fo:obj\\ -Fe:bin\\LivePlotter.dll COPY /Y assets\* bin COPY /Y assets\shaders\* bin diff --git a/examples/demo/activate.bat b/examples/cpp/activate.bat similarity index 100% rename from examples/demo/activate.bat rename to examples/cpp/activate.bat diff --git a/examples/demo/build.bat b/examples/cpp/build.bat similarity index 100% rename from examples/demo/build.bat rename to examples/cpp/build.bat diff --git a/examples/demo/export.bat b/examples/cpp/export.bat similarity index 100% rename from examples/demo/export.bat rename to examples/cpp/export.bat diff --git a/examples/demo/src/demo.cpp b/examples/cpp/src/demo.cpp similarity index 100% rename from examples/demo/src/demo.cpp rename to examples/cpp/src/demo.cpp diff --git a/examples/demo/src/util.cpp b/examples/cpp/src/util.cpp similarity index 100% rename from examples/demo/src/util.cpp rename to examples/cpp/src/util.cpp