A collection of common C++ dependencies for CS1950U projects, managed via CMake with toggleable options.
| Library | CMake Option | Target Name | Description |
|---|---|---|---|
| GLFW | DEP_GLFW |
glfw |
Window/context creation and input handling |
| GLM | DEP_GLM |
glm |
OpenGL Mathematics library |
| GLEW | DEP_GLEW |
glew_static or GLEW::GLEW |
OpenGL Extension Wrangler (static) |
| FreeType | DEP_FREETYPE |
freetype |
Font rendering library |
| Dear ImGui | DEP_IMGUI |
imgui |
Immediate mode GUI |
| ImGuizmo | DEP_IMGUIZMO |
ImGuizmo |
Gizmo tools for ImGui |
| STB | DEP_STB |
stb |
Header-only image loading and utilities |
| Assimp | DEP_ASSIMP |
assimp |
3D model import library |
| raudio | DEP_RAUDIO |
raudio |
Simple audio library |
Add this repository as a git submodule:
git submodule add https://github.com/BrownCSCI1950U/dependencies.git dependencies
git submodule update --init --recursiveIn your project's CMakeLists.txt, enable the dependencies you need before adding the subdirectory:
# Enable desired dependencies
set(DEP_GLFW ON)
set(DEP_GLM ON)
set(DEP_GLEW ON)
set(DEP_IMGUI ON)
# Add the dependencies directory
add_subdirectory(dependencies)
# Link to your target
target_link_libraries(your_target PRIVATE
glfw
glm
glew_static
imgui
)When DEP_IMGUI is enabled, the following backend options are available (all ON by default):
| Option | Default | Description |
|---|---|---|
DEP_IMGUI_BACKEND_GLFW |
ON |
GLFW platform backend |
DEP_IMGUI_BACKEND_OPENGL3 |
ON |
OpenGL3 renderer backend |
DEP_IMGUI_FREETYPE |
ON |
FreeType font rendering |
Note: ImGui backends have dependencies:
DEP_IMGUI_BACKEND_GLFWrequiresDEP_GLFW=ONDEP_IMGUI_FREETYPErequiresDEP_FREETYPE=ON
ImGuizmo requires ImGui. Enable both:
set(DEP_IMGUI ON)
set(DEP_IMGUIZMO ON)cmake_minimum_required(VERSION 3.16)
project(MyGame)
# Enable dependencies
set(DEP_GLFW ON)
set(DEP_GLM ON)
set(DEP_GLEW ON)
set(DEP_FREETYPE ON)
set(DEP_IMGUI ON)
set(DEP_STB ON)
set(DEP_ASSIMP ON)
add_subdirectory(dependencies)
add_executable(MyGame main.cpp)
target_link_libraries(MyGame PRIVATE
glfw
glm
glew_static
freetype
imgui
stb
assimp
)By default, dependencies are expected in subdirectories of this folder. Override paths if needed:
set(GLFW_SOURCE_DIR "/path/to/custom/glfw")
set(DEP_GLFW ON)
add_subdirectory(dependencies)See individual library directories for their respective licenses.