Skip to content

Cmake 4 #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Application build output
build/
distribution/
.cache/

# Created by CPack when executing tests.
Testing/
Expand All @@ -14,3 +15,4 @@ profile.json

# User defined CMake preset file.
CMakeUserPresets.json
*.sublime-workspace
4 changes: 1 addition & 3 deletions src/core/Core/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,14 @@ namespace App {
Window::Window(const Settings& settings) {
APP_PROFILE_FUNCTION();

const auto window_flags{
static_cast<SDL_WindowFlags>(SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI)};
const WindowSize size{DPIHandler::get_dpi_aware_window_size(settings)};

m_window = SDL_CreateWindow(settings.title.c_str(),
SDL_WINDOWPOS_CENTERED,
SDL_WINDOWPOS_CENTERED,
size.width,
size.height,
window_flags);
SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI);

Uint32 renderer_flags{SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED};
m_renderer = SDL_CreateRenderer(m_window, -1, renderer_flags);
Expand Down
124 changes: 124 additions & 0 deletions template.sublime-project
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
"folders": [
{
"path": ".",
}
],
"settings": {
"cmake": {
"build_folder": "$folder/build",
"command_line_overrides": {
"CMAKE_POLICY_VERSION_MINIMUM": "3.5",
},
},
"LSP": {
"clangd": {
"initializationOptions": {
"clangd.clang-tidy": true,
},
},
},
},
"build_systems":
[
{
"config": "Debug",
"env":
{
},
"generator": "Unix Makefiles",
"name": "Debug",
"target": "cmake_build",
"variants":
[
{
"build_target": "App",
"name": "App"
},
{
"artifact": "src/app/App.app/Contents/MacOS/App",
"build_target": "App",
"name": "Run: App",
"target": "cmake_run"
},
{
"artifact": "src/app/App.app/Contents/MacOS/App",
"build_target": "App",
"debug": true,
"name": "Run under LLDB: App",
"target": "cmake_run"
},
{
"build_target": "Core",
"name": "Core"
},
{
"build_target": "ResourcesTest",
"name": "ResourcesTest"
},
{
"artifact": "src/core/Tests/ResourcesTest",
"build_target": "ResourcesTest",
"name": "Run: ResourcesTest",
"target": "cmake_run"
},
{
"artifact": "src/core/Tests/ResourcesTest",
"build_target": "ResourcesTest",
"debug": true,
"name": "Run under LLDB: ResourcesTest",
"target": "cmake_run"
},
{
"build_target": "SDL2",
"name": "SDL2"
},
{
"build_target": "SDL2-static",
"name": "SDL2-static"
},
{
"build_target": "SDL2_test",
"name": "SDL2_test"
},
{
"build_target": "Settings",
"name": "Settings"
},
{
"build_target": "TestRunner",
"name": "TestRunner"
},
{
"build_target": "doctest_with_main",
"name": "doctest_with_main"
},
{
"build_target": "fmt",
"name": "fmt"
},
{
"build_target": "imgui",
"name": "imgui"
},
{
"build_target": "sdl_headers_copy",
"name": "sdl_headers_copy"
},
{
"build_target": "spdlog",
"name": "spdlog"
},
{
"build_target": "uninstall",
"name": "uninstall"
},
{
"name": "ctest",
"target": "ctest_run"
}
],
"working_dir": "$folder/build"
}
],
}
10 changes: 5 additions & 5 deletions vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@ include(FetchContent)
FetchContent_Declare(
doctest
GIT_REPOSITORY "https://github.com/onqtam/doctest.git"
GIT_TAG v2.4.11
GIT_TAG v2.4.12
)

FetchContent_Declare(
fmt
GIT_REPOSITORY "https://github.com/fmtlib/fmt.git"
GIT_TAG 11.0.2
GIT_TAG 11.2.0
)

FetchContent_Declare(
imgui
GIT_REPOSITORY "https://github.com/ocornut/imgui.git"
GIT_TAG 368123ab06b2b573d585e52f84cd782c5c006697 # Branch: docking, date: 07.11.2024, 07:58 GMT+1
GIT_TAG a92b53df7b2beb6cedab0bf182099f1c54acbbbd # Branch: docking, date: 02.06.2024, 08:21 GMT+3
)

FetchContent_Declare(
SDL2
GIT_REPOSITORY "https://github.com/libsdl-org/SDL.git"
GIT_TAG release-2.30.9
GIT_TAG release-2.32.8
)

FetchContent_Declare(
spdlog
GIT_REPOSITORY "https://github.com/gabime/spdlog.git"
GIT_TAG v1.15.0
GIT_TAG v1.15.3
)

# Settings
Expand Down
Loading