Skip to content

Commit 0cca518

Browse files
author
Hugo M. Ruiz-Mireles
committed
Merge branch 'main' of https://github.com/Hugo-RM/meowstro
2 parents 0ae4e63 + 14c7646 commit 0cca518

File tree

1 file changed

+48
-8
lines changed

1 file changed

+48
-8
lines changed

README.md

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,62 @@ The Python File `generate_cmake_presets.py` can be run with the following comman
4848
python generate_cmake_presets.py
4949
```
5050

51-
### 3. Build the Project
52-
Navigate to the project root and run the following commands:
51+
### 3. Creating Files (Skip if You're Not Creating a New File)
5352

54-
#### Configure CMake
55-
```sh
56-
cmake --preset my-build
53+
> ⚠️ **IMPORTANT: YOU MUST DO THIS EVERY TIME YOU CREATE A NEW `.cpp` OR `.hpp` FILE.**
54+
> If you don’t do this, the file will not be included in the project build. You must also rebuild the project after adding new files.
55+
56+
Depending on how you created your new file, you may need to manually move it to the correct directory. Visual Studio, for example, might place new files inside the `./build` directory.
57+
58+
If you used **Add Class** or **New Item** in Visual Studio:
59+
- Move the generated `.cpp` files to the `src/` directory.
60+
- Move the generated `.hpp` files to the `include/` directory.
61+
62+
Alternatively, you can just **create the files directly inside the `src/` and `include/` folders** before building.
63+
64+
After the files are correctly placed, you must update the `CMakeLists.txt` file so that they are included in the build:
65+
66+
```cmake
67+
# Define Source Files
68+
set(SOURCES
69+
src/file_1.cpp
70+
src/file_2.cpp
71+
...
72+
src/file_X.cpp
73+
)
74+
75+
# Define Header Files
76+
set(HEADERS
77+
include/file_1.hpp
78+
...
79+
include/file_X.hpp
80+
)
5781
```
58-
(`cmake --preset my-build` will create a `build/` directory automatically)
82+
83+
### 4. Build the Project
84+
You have two common ways to build and run the project: **Visual Studio** or the **Command Line**.
85+
86+
---
87+
88+
#### 🔷 Method 1: Using Visual Studio
89+
90+
1. Open the `.sln` file located inside the `build/` directory.
91+
2. In the **Solution Explorer**, right-click on the project named `game` and select **"Set as Startup Project"**.
92+
3. Press `Ctrl + F5` or click **Debug → Start Without Debugging** to run the project.
93+
94+
✅ That’s it! Visual Studio will automatically build and run the project.
95+
96+
---
97+
98+
#### ⚙️ Method 2: Using Command Line
99+
100+
Make sure you're in the root of the project and then run the following:
59101

60102
#### Change to the Build Directory
61103
```sh
62104
cd "./build"
63105
```
64106

65-
In the build directory run:
66-
67107
#### Build the Project
68108
```sh
69109
cmake --build .

0 commit comments

Comments
 (0)