Develop and extend ObjectiveFrame
ObjectiveFrame is a C++ application built upon several libraries. To build the application, required libraries have to be built. The main library used is Ivf++, an object-oriented 3D scene graph library encapsulating the OpenGL library. The second library is GLFW for creating OpenGL windows and providing a source of window events.
Prerequisites
Before building ObjectiveFrame, ensure you have the following prerequisites installed:
- CMake (version 3.24 or higher)
- Download from cmake.org
-
Ensure
cmakeis in your PATH -
C++ Compiler with C++20 support
- Windows: Visual Studio 2022 or later (with C++ workload)
-
Linux: GCC 10+ or Clang 12+
-
Git (for cloning repositories)
- Download from git-scm.com
vcpkg Setup
ObjectiveFrame uses vcpkg for dependency management. The build system automatically detects vcpkg in the following locations:
VCPKG_ROOTenvironment variable- Common installation paths:
- Windows:
c:/vcpkgore:/vcpkg - Linux:
$HOME/vcpkgor/usr/local/vcpkg
Installing vcpkg
If you don't have vcpkg installed:
Dependencies
ObjectiveFrame requires the following packages (automatically installed via vcpkg):
- PNG
- JPEG
- ZLIB
- glfw3
- GLEW
- OpenGL
- CURL
- ChaiScript (header-only)
See vcpkg.json in the root directory for the complete list of dependencies.
Building ObjectiveFrame
Using CMake directly (Recommended)
The build system works with both single-config and multi-config generators.
Windows (Visual Studio)
# Configure the project
cmake -S . -B build -G "Visual Studio 17 2022"
# Build Release configuration
cmake --build build --config Release
# Build Debug configuration
cmake --build build --config Debug
Alternatively, open build/objframe2.sln in Visual Studio and build from there.
Linux (Makefile/Ninja)
# Configure for Release
cmake -S . -B build-release -DCMAKE_BUILD_TYPE=Release
# Build Release
cmake --build build-release
# Configure for Debug
cmake -S . -B build-debug -DCMAKE_BUILD_TYPE=Debug
# Build Debug
cmake --build build-debug
Using Ninja (Faster builds)
On both Windows and Linux, you can use Ninja for faster builds:
# Install Ninja
# Windows: choco install ninja
# Linux: sudo apt install ninja-build
# Configure with Ninja
cmake -S . -B build-ninja -G Ninja -DCMAKE_BUILD_TYPE=Release
# Build
cmake --build build-ninja
Build Options
You can customize the build with these CMake options:
CMAKE_BUILD_TYPE: Set toRelease,Debug, orRelWithDebInfoCMAKE_INSTALL_PREFIX: Installation directoryBUILD_TESTING: Enable/disable tests (default: ON)
Example:
Running ObjectiveFrame
After building, you can run ObjectiveFrame from the installation directory:
Troubleshooting
Common Issues
- vcpkg not found: Ensure
VCPKG_ROOTis set or vcpkg is in a standard location - CMake errors: Make sure you have CMake 3.24+
- Compiler errors: Ensure your compiler supports C++20
- Missing dependencies: Run
vcpkg installmanually if needed
Manual vcpkg Installation
If automatic dependency installation fails:
# Install dependencies manually
vcpkg install --triplet x64-windows # Windows
vcpkg install --triplet x64-linux # Linux
Contributing
When contributing to ObjectiveFrame:
- Fork the repository
- Create a feature branch
- Make your changes
- Test your build on both Windows and Linux
- Submit a pull request
Building Ivf++
Ivf++ is not automatically built via vcpkg. You need to build it manually. The recommended approach is to clone and build Ivf++ in a directory next to the objectiveframe project source.
Prerequisites for Ivf++
- CMake 3.24+
- vcpkg (same setup as ObjectiveFrame)
- C++20 compatible compiler
Building Ivf++
# Clone Ivf++ repository next to objectiveframe
cd ..
git clone https://github.com/jonaslindemann/ivfplusplus.git
# Create build directory
cd ivfplusplus
mkdir build
cd build
# Configure and build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
# Install (optional, or set IVFPLUSPLUS_DIR)
cmake --install . --prefix ../install
Integration with ObjectiveFrame
Set the IVFPLUSPLUS_DIR environment variable to point to the Ivf++ installation:
Or pass it to CMake:
Building GLFW
GLFW is automatically installed via vcpkg. No manual building required.