This is an example C++ project with features:
-
Building
- Linux-aarch64 (with QEMU)
- Linux x64
- MacOSX x64
- Windows x64
- Android ARMv8
-
Configuration
-
version.h
generated by cmake configure file - Macro definitions generated by options and cmake configure file
- Create imported target in
helloConfig.cmake
, together with global variables
-
-
Testing
- Use GoogleTest for C++ unittest
- Integrate GoogleTest with CMake
- GCC compiler test coverage report
- Clang compiler test coverage report
- CodeCov integration for CI coverage display
- gcovr integration
- Visual Studio Community: use OpenCppCoverage plugin
-
Installing
- Create static library and executable targets
- Providing
helloConfig.cmake
for furtherfind_package(hello)
- Installed
helloConfig.cmake
with portable prefix instead of hard-coded -
helloConfig.cmake
handle release/debug modes separately by postfix_d
- Example project demonstrate how
find_package(hello)
use - Create shared library for Linux, Android and Windows platforms
-
CI / CD
- Github Action
- build and test after each commit pushed
- provide artifactory download after each build
- automatically upload and publish and release
- TravisCI arm64 build
- Github Action
-
Using
- Example cmake-based project with
find_package()
- Example cmake-based project with
If your target feature is not listed above, you may create a issue for that.
git clone https://github.com/zchrissirhcz/HelloCpp
cd HelloCpp
mkdir build && cd build
cmake ..
cmake --build .
make test
make coverage
cd coverage_report
python -m http.server 7082
Use cmake generate .sln
file, run test, then switch to OpenCppCoverage plugin's output page: