From 7adcd780b0944318c31db52a65b0bacaa653a0a5 Mon Sep 17 00:00:00 2001 From: galeon Date: Mon, 22 Sep 2025 23:08:20 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D1=8C=D1=82?= =?UTF-8?q?=D0=B5=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D0=B5=D0=BA=D1=82=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 21 +++++++++ CMakePresets.json | 101 +++++++++++++++++++++++++++++++++++++++++ minecraft-launcher.cpp | 12 +++++ minecraft-launcher.h | 8 ++++ 4 files changed, 142 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 CMakePresets.json create mode 100644 minecraft-launcher.cpp create mode 100644 minecraft-launcher.h diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..e908e7a --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,21 @@ +# CMakeList.txt: проект CMake для minecraft-launcher; включите исходный код и определения, +# укажите здесь логику для конкретного проекта. +# +cmake_minimum_required (VERSION 3.8) + +# Включение горячей перезагрузки для компиляторов MSVC, если поддерживается. +if (POLICY CMP0141) + cmake_policy(SET CMP0141 NEW) + set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$,$>,$<$:EditAndContinue>,$<$:ProgramDatabase>>") +endif() + +project ("minecraft-launcher") + +# Добавьте источник в исполняемый файл этого проекта. +add_executable (minecraft-launcher "minecraft-launcher.cpp" "minecraft-launcher.h") + +if (CMAKE_VERSION VERSION_GREATER 3.12) + set_property(TARGET minecraft-launcher PROPERTY CXX_STANDARD 20) +endif() + +# TODO: Добавьте тесты и целевые объекты, если это необходимо. diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 0000000..f4bc98b --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,101 @@ +{ + "version": 3, + "configurePresets": [ + { + "name": "windows-base", + "hidden": true, + "generator": "Ninja", + "binaryDir": "${sourceDir}/out/build/${presetName}", + "installDir": "${sourceDir}/out/install/${presetName}", + "cacheVariables": { + "CMAKE_C_COMPILER": "cl.exe", + "CMAKE_CXX_COMPILER": "cl.exe" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } + }, + { + "name": "x64-debug", + "displayName": "x64 Debug", + "inherits": "windows-base", + "architecture": { + "value": "x64", + "strategy": "external" + }, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "x64-release", + "displayName": "x64 Release", + "inherits": "x64-debug", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + }, + { + "name": "x86-debug", + "displayName": "x86 Debug", + "inherits": "windows-base", + "architecture": { + "value": "x86", + "strategy": "external" + }, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "x86-release", + "displayName": "x86 Release", + "inherits": "x86-debug", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + }, + { + "name": "linux-debug", + "displayName": "Linux Debug", + "generator": "Ninja", + "binaryDir": "${sourceDir}/out/build/${presetName}", + "installDir": "${sourceDir}/out/install/${presetName}", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + }, + "vendor": { + "microsoft.com/VisualStudioRemoteSettings/CMake/1.0": { + "sourceDir": "$env{HOME}/.vs/$ms{projectDirName}" + } + } + }, + { + "name": "macos-debug", + "displayName": "macOS Debug", + "generator": "Ninja", + "binaryDir": "${sourceDir}/out/build/${presetName}", + "installDir": "${sourceDir}/out/install/${presetName}", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + }, + "vendor": { + "microsoft.com/VisualStudioRemoteSettings/CMake/1.0": { + "sourceDir": "$env{HOME}/.vs/$ms{projectDirName}" + } + } + } + ] +} diff --git a/minecraft-launcher.cpp b/minecraft-launcher.cpp new file mode 100644 index 0000000..249ff2f --- /dev/null +++ b/minecraft-launcher.cpp @@ -0,0 +1,12 @@ +// minecraft-launcher.cpp: определяет точку входа для приложения. +// + +#include "minecraft-launcher.h" + +using namespace std; + +int main() +{ + cout << "Hello CMake." << endl; + return 0; +} diff --git a/minecraft-launcher.h b/minecraft-launcher.h new file mode 100644 index 0000000..804055d --- /dev/null +++ b/minecraft-launcher.h @@ -0,0 +1,8 @@ +// minecraft-launcher.h : включаемый файл для стандартных системных включаемых файлов +// или включаемые файлы для конкретного проекта. + +#pragma once + +#include + +// TODO: установите здесь ссылки на дополнительные заголовки, требующиеся для программы.