CppTest
CppTest

整体架构

一些相互独立的C++/C小程序或者验证程序,通过CMake组织,大部分都可以同时运行在Windows/Linux/Mac平台。各个程序相互独立,方便拆解。

通过本项目你可以学习到如下内容:

如何构建

一、安装vcpkg: https://learn.microsoft.com/zh-cn/vcpkg/get_started/get-started

注意配置环境变量VCPKG_INSTALLATION_ROOT为vcpkg的根目录,同时配置PATH环境变量

二、安装依赖, 参考: <ttps://github.com/jiangxincode/CppTest/actions/workflows/BuildAndRelease.yml>

Linux:

sudo apt install build-essential autotools-dev libtool
sudo apt install -y libgtk-3-dev
sudo apt install libgl-dev libglu1-mesa-dev libx11-dev libxrandr-dev libxi-dev

MacOS:

brew libtool automake
brew install gtk+3 libffi
brew install xquartz libx11 libxi libxrandr libxxf86vm mesa

Windows

安装Microsoft Virual C++

三、构建, 参考: <ttps://github.com/jiangxincode/CppTest/actions/workflows/BuildAndRelease.yml>

cmake --preset ${{ matrix.preset }}
cmake --build --preset ${{ matrix.preset }}
ctest --preset ${{ matrix.preset }}

Linux: ["linux-x64-debug", "linux-x64-release"] macos: ["macos-x64-debug", "macos-x64-release"] windows: ["windows-x64-debug", "windows-x64-release", "windows-x64-mingw-debug", "windows-x64-mingw-release"]

文件说明

src/OpenGL

通过Demo学习OpenGL+FreeGlut

src/OpenSSLTest

通过Demo学习OpenSSL中的加解密算法

src/msvc/Elevator

一个基于C++和MFC的电梯调度演示程序

src/LCTest

Some exercises for C in Linux environment

src/ImageViewer

An image viewer. 基于GTK+

src/SumCode

计算某个项目的代码行数

src/CTest

main1xxy.c C语言程序设计, 2012 实验教材为《C语言程序设计教程学习指导》,xx代表章节,y代表该章节的习题序号

src/SingleFileCpp

各个目录下都是单个C++文件,如:

src/IdiomSolitaire

一个成语接龙小程序

src/others

Contributing

  1. Fork it
  2. Create your feature branch(git check -b my-new-feature)
  3. Commit your changes(git commit -am "Add some feature")
  4. Push to the branch(git push origin my-new-feature)
  5. Create new Pull Request

License