From b6833833b0d4c25472a9547254d7744c1b7a40a2cdd41e4cda134cfa5b89ec5d Mon Sep 17 00:00:00 2001 From: ArchZer0 Date: Sun, 16 Aug 2026 18:38:40 +0800 Subject: [PATCH] Init cmake --- .gitignore | 4 +++- CMakeLists.txt | 8 ++++++++ CMakePresets.json | 17 +++++++++++++++++ PssPhoto.cpp | 5 +++++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 CMakeLists.txt create mode 100644 CMakePresets.json create mode 100644 PssPhoto.cpp diff --git a/.gitignore b/.gitignore index 8ee92fa..9944c20 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ CMakeLists.txt.user CMakeCache.txt CMakeFiles CMakeScripts +out Testing Makefile cmake_install.cmake @@ -439,7 +440,8 @@ FodyWeavers.xsd .LSOverride # Icon must end with two \r -Icon +Icon + # Thumbnails ._* diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..91ee6f0 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.10.0) +project(PssPhoto VERSION 0.1.0 LANGUAGES C CXX) + +add_library(PssPhoto PssPhoto.cpp) + +include(CTest) +enable_testing() + diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 0000000..8e31bb1 --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,17 @@ +{ + "version": 8, + "configurePresets": [ + { + "name": "Clang", + "displayName": "使用工具链文件配置预设", + "description": "设置 Ninja 生成器、版本和安装目录", + "generator": "Ninja", + "binaryDir": "${sourceDir}/out/build/${presetName}", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_TOOLCHAIN_FILE": "", + "CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}" + } + } + ] +} \ No newline at end of file diff --git a/PssPhoto.cpp b/PssPhoto.cpp new file mode 100644 index 0000000..474a621 --- /dev/null +++ b/PssPhoto.cpp @@ -0,0 +1,5 @@ +#include + +void say_hello(){ + std::cout << "Hello, from PssPhoto!\n"; +}