You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-11Lines changed: 14 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,33 +48,36 @@ The Python File `generate_cmake_presets.py` can be run with the following comman
48
48
python generate_cmake_presets.py
49
49
```
50
50
51
-
### 3. Creating files (skip if you're not creating new file)
52
-
Depending on the method you used to create a new file, you will need to somehow get that file to the src or include directories. They will probably be directly under the ./build directory if you're already using visual studio. If not just locate the file(s) and cut and paste them to the correct place.
51
+
### 3. Creating Files (Skip if You're Not Creating a New File)
53
52
54
-
If you used add class or new item in visual studio, you will need to simply cut and paste the files into the right folder (include being .hpp files, src being .cpp files).
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
55
56
-
You can also just create the files in the src and include files then build the project to have them there.
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
57
58
-
After the files are in the src and include folders, you will need to add them into the `CMakeLists.txt`. You will scroll down to see the following
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.
59
61
60
-
```txt
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
61
67
# Define Source Files
62
68
set(SOURCES
63
69
src/file_1.cpp
64
70
src/file_2.cpp
65
71
...
66
72
src/file_X.cpp
67
73
)
68
-
# ... means that there can be more files between them
74
+
69
75
# Define Header Files
70
76
set(HEADERS
71
77
include/file_1.hpp
72
78
...
73
-
include/file_x.cpp
79
+
include/file_X.hpp
74
80
)
75
-
```
76
-
77
-
Just add the filename(s) to this part of the `CMakeLists.txt` and build the project for it to work :).
78
81
79
82
### 4. Build the Project
80
83
Navigate to the project root and run the following commands:
0 commit comments