Creating a Project
Once Mach is installed, you can create a new project using the Mach CLI.
Create a Project
Section titled “Create a Project”Open a terminal in the directory where you want to create your project and run:
mach new hello-worldMach creates a new hello-world directory containing a ready-to-build
application.
Move into the project directory:
cd hello-worldProject Structure
Section titled “Project Structure”A newly created Mach project has the following structure:
hello-world/├── src/│ └── main.cpp├── .gitignore└── CMakeLists.txtCMakeLists.txt
Section titled “CMakeLists.txt”The CMakeLists.txt file contains the CMake configuration used to build
your application and link it with Mach.
The src directory contains your application’s source code.
src/main.cpp
Section titled “src/main.cpp”main.cpp is the entry point of your application. This is where the
Mach application is created and configured.
.gitignore
Section titled “.gitignore”Specifies files and directories that Git should ignore, including build artifacts generated by Mach.
Next, you’ll take a closer look at the endpoint included in your new application.