diff --git a/CMakeLists.txt b/CMakeLists.txt index 20f09da..79e5d86 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -128,6 +128,13 @@ else() # NOT (ANDROID OR EMSCRIPTEN) target_compile_definitions(system3 PRIVATE _CRT_NONSTDC_NO_DEPRECATE _CRT_SECURE_NO_WARNINGS) target_compile_options(system3 PRIVATE /utf-8 /wd4244) target_link_libraries(system3 PRIVATE SDL2::SDL2main SDL2::SDL2 SDL2_ttf::SDL2_ttf) + add_custom_command(TARGET system3 POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" "$" + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" "$" + COMMENT "Copying SDL runtime DLLs" + VERBATIM) set_target_properties(system3 PROPERTIES WIN32_EXECUTABLE TRUE VS_DEBUGGER_ENVIRONMENT "PATH=${SDL2_LIBDIR}$${SDL2TTF_LIBDIR}$$ENV{PATH}") diff --git a/README.md b/README.md index 2d82978..7820aa0 100644 --- a/README.md +++ b/README.md @@ -161,19 +161,21 @@ $ make ### Windows (Microsoft Visual Studio) -- Visual Studio 2022 can be used to clone this repository and will - automatically clone submodules as well. -- Install [CMake](https://cmake.org/download/). (The CMake integration in - Visual Studio does not work.) -- In the CMake GUI, press the "Browse Source..." button and select the root - folder of this repository. -- Press the "Browse Build..." button. Create a new folder (e.g., `out`) under - the top-level directory of the repository and select it. -- Press the "Configure" button. Specify the generator for your version of - Visual Studio and click "Finish." -- Press the "Generate" button. -- A `System3.sln` file should be generated in the build folder. Open it with - Visual Studio. +- Install Visual Studio 2026 with the **Desktop development with C++** + workload. +- On the Visual Studio start screen, select **Clone a repository** and clone + this repository. +- Wait until the Output window reports `CMake generation finished.` +- Select **Build > Build All** to build the project. + +The executable and its runtime DLLs are generated under +`out/build/x64-Debug`: + +- `system3.exe` +- `SDL2.dll` +- `SDL2_ttf.dll` + +To run a game, copy all three files to the game folder and run `system3.exe`. ### Emscripten