From 06aebfeb100d3841b99559658dda7ae261232966 Mon Sep 17 00:00:00 2001 From: Aditya <97450298+1234-ad@users.noreply.github.com> Date: Thu, 8 Jan 2026 21:25:53 +0530 Subject: [PATCH 1/3] Add STB and FileWatcher as Git submodules - Add stb as submodule from nothings/stb repository - Add FileWatcher as submodule from ThomasMonkman/filewatch repository - Ensures consistent dependency management across all external libraries - Fixes issue #17 --- .gitmodules | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitmodules b/.gitmodules index b57e2f9..1fbc72a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -12,3 +12,11 @@ [submodule "external/glm"] path = external/glm url = https://github.com/g-truc/glm.git +[submodule "external/stb"] + path = external/stb + url = https://github.com/nothings/stb.git + branch = master +[submodule "external/filewatch"] + path = external/filewatch + url = https://github.com/ThomasMonkman/filewatch.git + branch = master From 48411fdb526d827ab8def8fbb5568b50fdf5fee5 Mon Sep 17 00:00:00 2001 From: Aditya <97450298+1234-ad@users.noreply.github.com> Date: Thu, 8 Jan 2026 21:26:06 +0530 Subject: [PATCH 2/3] Update CMakeLists.txt to include stb and filewatch submodule paths - Add external/stb to include directories for stb_image.h - Add external/filewatch to include directories for FileWatch.hpp - Ensures proper header resolution from submodules - Part of fix for issue #17 --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 53e0452..c0eaed0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,8 @@ target_include_directories(glint PRIVATE ${CMAKE_SOURCE_DIR}/external/glad/include ${CMAKE_SOURCE_DIR}/external/glfw/include ${CMAKE_SOURCE_DIR}/external/glm + ${CMAKE_SOURCE_DIR}/external/stb + ${CMAKE_SOURCE_DIR}/external/filewatch ${CMAKE_SOURCE_DIR}/external/ ) From bd45c522b05df9093cd20656a1826a9c9c8f26b7 Mon Sep 17 00:00:00 2001 From: Aditya <97450298+1234-ad@users.noreply.github.com> Date: Thu, 8 Jan 2026 21:26:24 +0530 Subject: [PATCH 3/3] Add submodule migration guide - Document changes made in this PR - Provide step-by-step migration instructions for existing users - Explain benefits of submodule approach - Part of fix for issue #17 --- SUBMODULE_MIGRATION.md | 67 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 SUBMODULE_MIGRATION.md diff --git a/SUBMODULE_MIGRATION.md b/SUBMODULE_MIGRATION.md new file mode 100644 index 0000000..a433ee8 --- /dev/null +++ b/SUBMODULE_MIGRATION.md @@ -0,0 +1,67 @@ +# Submodule Migration Guide + +## Overview +This PR migrates STB and FileWatcher from direct file inclusion to Git submodules for better dependency management and version control. + +## Changes Made + +### 1. Added Git Submodules +- **STB**: Added as submodule from `https://github.com/nothings/stb.git` +- **FileWatcher**: Added as submodule from `https://github.com/ThomasMonkman/filewatch.git` + +### 2. Updated Build Configuration +- Modified `CMakeLists.txt` to include submodule paths +- Updated include directories to reference submodule locations + +## Migration Steps for Existing Users + +If you have an existing clone of this repository, follow these steps: + +### 1. Remove Old Files +```bash +# Remove the old standalone files +rm external/FileWatch.hpp +rm src/stb_image.h +``` + +### 2. Initialize Submodules +```bash +# Update .gitmodules +git pull origin main + +# Initialize and update all submodules +git submodule update --init --recursive +``` + +### 3. Verify Installation +After initialization, you should have: +- `external/stb/` directory with STB headers +- `external/filewatch/` directory with FileWatch headers + +### 4. Update Include Paths (if needed) +The CMakeLists.txt has been updated to include the new paths. If you have custom build scripts, update them to reference: +- `external/stb/` for STB headers +- `external/filewatch/` for FileWatch headers + +## For New Users + +Simply clone with submodules: +```bash +git clone --recursive https://github.com/CGS-IITKGP/OpenGL-template.git +``` + +Or if already cloned: +```bash +git submodule update --init --recursive +``` + +## Benefits + +1. **Version Control**: Track specific versions of dependencies +2. **Consistency**: All external dependencies managed uniformly +3. **Updates**: Easy to update to newer versions +4. **Size**: Reduces repository size by not duplicating large header files + +## Fixes + +Closes #17