Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ jobs:
run: |
set -eux

touch CMakePresets.json

JA2Application=$(echo '${{ matrix.application }}' | tr '[:lower:]' '[:upper:]')

echo "
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
/.vs/
/build/
/out/
/CMakePresets.json
/CMakeUserPresets.json
/CMakeSettings.json
/lib/
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ if(USE_SCCACHE)
endif()
endif()

include(cmake/CopyUserPresetTemplate.cmake)
CopyUserPresetTemplate()

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
Expand Down
61 changes: 61 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 20,
"patch": 0
},
"configurePresets": [
{
"name": "base",
"hidden": true,
"description": "Applications is JA2|JA2MAPEDITOR|JA2UB|JA2UBMAPEDITOR|empty(all 4); override CMAKE_RUNTIME_OUTPUT_DIRECTORY in CMakeUserPresets.json to debug another install.",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"architecture": {
"value": "x86",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_RUNTIME_OUTPUT_DIRECTORY": "${sourceDir}/gamedir"
}
},
{
"name": "msvc",
"hidden": true,
"inherits": "base",
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [ "Windows" ],
"intelliSenseMode": "windows-msvc-x86"
}
}
},
{
"name": "msvc-relwithdebinfo",
"inherits": "msvc",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{
"name": "msvc-debug",
"inherits": "msvc",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "msvc-release",
"inherits": "msvc",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
}
],
"buildPresets": [
{ "name": "msvc-relwithdebinfo", "configurePreset": "msvc-relwithdebinfo" },
{ "name": "msvc-debug", "configurePreset": "msvc-debug" },
{ "name": "msvc-release", "configurePreset": "msvc-release" }
]
}
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,9 @@ Visit the [releases page](https://github.com/1dot13/source/releases) to download
* Double-click on `Folder View` in the `Solution Explorer`
* Click `Open a local folder`
* Use this option if you already cloned the repository yourself.
3. Visual Studio will automatically detect the CMake configuration files and will run the CMake generation. There will bet a CMake error in the logs saying `No existing preset was found, copied a preset template to [some_path]`. This is normal and only happens once.
4. Click on the dropdown that says `x64-Debug` and select `Manage configurations...`. This should trigger Visual Studio to load the `CMakeUserPresets.json` file it just copied. Now you can close the window for managing the configurations.
5. The `x64-Debug` option should have been replaced by `1dot13 Debug`. Click it and select `Manage configurations...` again. Here is where you configure the language for the built executables as well as which ones to build, Most important, here is where you set `CMAKE_RUNTIME_OUTPUT_DIRECTORY` to the path to your JA2 1.13 installation. This will be used for debugging. Note that the path needs to have a working 1.13 installation, and that includes the 1.13 game data.
6. You can use `Build -> Build All` to build the executables you selected in the configuration.
3. Visual Studio detects `CMakePresets.json` and lists the `msvc-*` configurations. Executables are written to `gamedir/`.
4. To build only some applications, or to debug against a different JA2 1.13 install, add/modify a `CMakeUserPresets.json` in the source root that inherits one of the shipped presets and sets the `Applications` and/or `CMAKE_RUNTIME_OUTPUT_DIRECTORY` `cacheVariables`. Language is chosen at runtime, not at configure time.
5. Use `Build -> Build All` to build.


### Reports
Expand Down
10 changes: 0 additions & 10 deletions cmake/CopyUserPresetTemplate.cmake

This file was deleted.

41 changes: 0 additions & 41 deletions cmake/presets/CMakePresets.json

This file was deleted.

Loading