init version.

This commit is contained in:
taynpg 2025-04-17 20:10:00 +08:00
commit 1443f14fb3
9 changed files with 197 additions and 0 deletions

17
.clang-format Normal file
View File

@ -0,0 +1,17 @@
BasedOnStyle: LLVM
IndentWidth: 4
PointerAlignment: Left
AccessModifierOffset: -4
BreakBeforeBraces: Custom
BraceWrapping:
AfterFunction: true
AfterClass: true
Cpp11BracedListStyle: true
ReflowComments: true
SpacesBeforeTrailingComments: 3
TabWidth: 4
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ColumnLimit: 130
AllowShortBlocksOnASingleLine: Never
AllowShortFunctionsOnASingleLine: None
AllowShortEnumsOnASingleLine: false

45
.gitignore vendored Normal file
View File

@ -0,0 +1,45 @@
# Prerequisites
*.d
.idea
cmake-build-*
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
!lebo_motor.lib
!lebo_motor.dll
!liblebo_motor.so
# Executables
*.exe
*.out
*.app
build
*.user
compile_commands.json
.vs
out
.cache
CMakeLists.txt.*

38
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,38 @@
{
"files.autoSave": "onFocusChange",
"editor.fontSize": 14,
"editor.fontFamily": "'Source Code Pro', 'Source Code Pro', 'Source Code Pro'",
"terminal.integrated.fontFamily": "Source Code Pro",
"cmake.configureOnOpen": true,
"cmake.debugConfig": {
"console": "integratedTerminal",
"setupCommands": [
{
"description": "-gdb-set charset utf-8",
"text": "-gdb-set charset UTF-8"
},
{
"description": "Enable gdb pretty-printing",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
//"visualizerFile": "${workspaceRoot}/.vscode/qt6.natvis",
"args": [
]
},
// "cmake.configureSettings": {
// "CMAKE_TOOLCHAIN_FILE": "${env:VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
// },
"cmake.options.statusBarVisibility": "visible",
"cmake.generator": "Ninja",
"C_Cpp.default.compileCommands": "${workspaceRoot}/build/compile_commands.json",
"C_Cpp.default.cppStandard": "c++17",
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"editor.inlayHints.enabled": "off",
"editor.unicodeHighlight.allowedLocales": {
"ja": true,
"zh-hant": true,
"zh-hans": true
}
}

15
CMakeLists.txt Normal file
View File

@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 3.16)
project(MiniToolSets LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(WXWIDGETS_DIR "D:/Program/Dev/wxWidgets")
set(CMAKE_DEBUG_POSTFIX "d")
message(STATUS "System: ${CMAKE_SYSTEM_NAME}")
message(STATUS "Compiler CXX ID: ${CMAKE_CXX_COMPILER_ID}")
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib/${CMAKE_BUILD_TYPE})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE}/)
add_subdirectory(ParamMatchCnt)

View File

@ -0,0 +1,25 @@
cmake_minimum_required(VERSION 3.16)
project(ParamMatchCnt LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_PREFIX_PATH
${CMAKE_PREFIX_PATH}
${WXWIDGETS_DIR}
)
if (MSVC)
add_compile_options(/utf-8)
endif()
set(PSOURCES
mainframe.h
mainframe.cxx
main.cxx
)
find_package(wxWidgets CONFIG REQUIRED)
add_executable(ParamMatchCnt ${PSOURCES})
target_link_libraries(ParamMatchCnt PRIVATE wx::core wx::base)
set_target_properties(ParamMatchCnt PROPERTIES WIN32_EXECUTABLE TRUE)

15
ParamMatchCnt/main.cxx Normal file
View File

@ -0,0 +1,15 @@
#include "mainframe.h"
class ParamMatchCntApp : public wxApp
{
public:
virtual bool OnInit()
{
MainFrame* frame = new MainFrame(wxT("ParamMatchCnt"));
frame->Show(true);
return true;
}
};
wxIMPLEMENT_APP(ParamMatchCntApp);
DECLARE_APP(ParamMatchCntApp);

View File

@ -0,0 +1,14 @@
#include "mainframe.h"
MainFrame::MainFrame(const wxString& title) : wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(800, 600))
{
}
MainFrame::~MainFrame()
{
}
bool MainFrame::Init()
{
return false;
}

19
ParamMatchCnt/mainframe.h Normal file
View File

@ -0,0 +1,19 @@
#ifndef MAINFRAME_H
#define MAINFRAME_H
#include <wx/wx.h>
class MainFrame : public wxFrame
{
public:
MainFrame(const wxString& title);
~MainFrame();
public:
bool Init();
private:
};
#endif // MAINFRAME_H

9
version.h.in Normal file
View File

@ -0,0 +1,9 @@
#ifndef VERSION_H
#define VERSION_H
#define VERSION_GIT_COMMIT "@VERSION_GIT_HASH@"
#define VERSION_GIT_BRANCH "@VERSION_GIT_BRANCH@"
#define VERSION_NUM "@PROJECT_VERSION@"
#define VERSION_URL "@PROJECT_URL@"
#endif