[micro{gl}]

Introduction

There are various ways, that microgl can be consumed and used

Installing micro{gl}

microgl is a headers only library, which gives the following install possibilities:

  1. Using cmake to invoke the install target, that will copy everything in your system via
$ mkdir cmake-build-release
$ cd cmake-build-release
$ cmake -DCMAKE_BUILD_TYPE=Release ..
$ cmake --install .
  1. Copying the include/microgl to anywhere you want.

Consuming micro{gl}

Following options are available:

  1. copy the project to a sub folder of your project. inside your CMakeLists.txt add
add_subdirectory(/path/to/microgl)
target_link_libraries(your_app microgl)
  1. If you installed micro{gl} with option 1 (see above) at your system, you can instead
find_package(microgl CONFIG REQUIRED)
target_link_libraries(your_app microgl::microgl)
  1. If you have not installed, you can add in your app's CMakeLists.txt
target_include_directories(app path/to/microgl/folder/include/)
  1. If you manually copied the include/microgl to the default system include path, you can use cmake/Findmicrogl.cmake to automatically create the cmake targets
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/path/to/Findmicrogl/folder)
find_package(microgl REQUIRED)
target_link_libraries(your_app microgl::microgl)
  1. Just copy the include/microgl into a sub folder of your project and include the header files you need with relative path in your source files.

Running Examples

First make sure you have

  • SDL2 installed at your system.
  • cmake installed at your system.

There are two ways:

  1. Use your favourite IDE to load the root CMakeLists.txt file, and then it will pick up all of the targets, including the examples
  2. Using the command line:
$ mkdir cmake-build-release
$ cd cmake-build-release
$ cmake -DCMAKE_BUILD_TYPE=Release ..
$ cmake --build . --target <example_name>
$ ../examples/bin/example_name

All Rights Reserved, Tomer Shalev, (2022-2025)