C++ Template Repository with Conan2 and Premake5 (Windows and Linux support)
C++ Template Repository with Conan2 and Premake5 for Windows and Linux. Out of the Box unit-testing and GitHub actions.
Please make sure to read the WHOLE readme and follow all instructions!
Windows
for Windows
Linux
for Linux
x64
buildsBefore you are getting started make sure to install the following applications:
pip install conan
) please use version 2.0.7
(it might work on newer version but conan2 changes a thing with every update!)After you used this template for creating your new project please make sure to follow all these steps to setup your repository correctly.
mox.bat init
, open the visual studio and build the solution (Batch build)../mox.sh autogen
. This should produce the file ./deploy/Release/package.zip
(You can also do this on windows. Run mox.bat autogen
shall have the same result)../mox.lua
(The configuration file for your repository) and understand all the settings. Modify them for your needs. If you modify mox.lua
or any other project related .lua
file later. Please make sure to always rerun mox.bat init
. Copying or removing visual studio projects and solutions is only possible when visual studio is closed! You can remove all visual studio and makefile by running mox.bat clean project
../src/build.lua
works.cmox_project_architecture
in mox.lua
:
single
: Only one single build file is used. Use this architecture if you are writing a simple project with only one executable and no shared or static libs.flat
: Flat build architecture in the source subfolder (cmox_src_folder
). Each subfolder is one project with it's own dedicated build.lua
file inside.hierarchical
: Projects are group into groups. The src folder contains a subfolder for each group. Within the groups subfolder each project is represented as a subdirectory with it's own build.lua
file.manual
: MoxPP will not handle automatic including of the build.lua
files. Instead MoxPP will call a custom callback function provided by you. Implement the function cmox_function_includeprojects
within mox.lua
.BUILDING.md
so that it's still correct../scripts
folder. You can run the script with the mox tool mox.bat <SCRIPT_NAME>
working dir is the repository root. Make sure to your script to the list of actions in BUILDING.md
.mox.lua
and delete the test
directory. You can also modify the building of unit tests or the library. MoxPP is shipped with gtest but has no hard requirements on it.There is more information in BUILDING.md
(That you should keep) on how to build the project.
We have an extensive video that showcases how this template works: https://youtu.be/u-2syomFD2s
The code shipped with MoxPP is licensed under the MIT License
. All python and lua scripts have the license embedded into them. Additional attribution is not required as long as the template is not redistributed itself. Feel free to use the template in your projects. This is no legal advice! Consult your lawyer!