Radium Engine  1.5.0
Radium Dependencies Management

Radium relies on several external libraries to load files or to represent some data:

  • [Core] Eigen, OpenMesh, nlohmann_json
  • [Engine] glm, globjects, glbindings, tinyEXR
  • [IO] Assimp
  • [Gui] Qt Core, Qt Widgets and Qt OpenGL v5.5+ (5.14 at least, Qt6 support is experimental), PowerSlider
  • [doc] Doxygen-awesome-css
  • stb_image

We developed a series of tools to fetch and compile these dependencies easily, except for Qt, which needs to be installed and passed to cmake through the variables CMAKE_PREFIX_PATH or Qt5_DIR Qt6_DIR (see documentation at https://doc.qt.io/qt-5.15/cmake-manual.html#getting-started).

Dependencies management systems

We offer two different systems to handle external dependencies (see details and how-to in the following sections):

  1. [recommended] external build: the user compiles and installs once for all the dependencies using a dedicated cmake project. Then, Radium cmake project is configured to link with installed dependencies.
  2. manual management: users can also provide their own version of the dependencies through cmake packages.
Warning
Dependencies need to be built with the same build type (ie. Release, Debug) than Radium.

Building and installing Radium dependencies once for all

We provide a standalone cmake project (Radium-Engine/external/CMakeLists.txt) to compile and install the Radium dependencies at any location.

Configuration and compilation of the dependencies

External dependencies have to be installed outside Radium-Engine source tree.

# from wherever you want outside radium source tree
# in release
cmake -S Radium-Engine/external -B builds/radium-external-build-r -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=installs/radium-external-r
cmake --build builds/radium-external-build-r --config Release --parallel
# in debug
cmake -S Radium-Engine/external -B builds/radium-external-build-d -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=installs/radium-external-d
cmake --build builds/radium-external-build-d --config Debug --parallel

If not given on the command line, the installation directory is set by default to Radium-Engine/{CMAKE_CURRENT_BINARY_DIR}/Bundle-${CMAKE_CXX_COMPILER_ID} for CMAKE_BUILD_TYPE=Release, and Radium-Engine/{CMAKE_CURRENT_BINARY_DIR}/Bundle-${CMAKE_CXX_COMPILER_ID}-${CMAKE_BUILD_TYPE} for any other CMAKE_BUILD_TYPE.

Getting started with Visual Studio

Open external/CMakeLists.txt and edit cmake settings or CMakeSettings.json. External build and install have to be outside Radium-Engine source directory. For instance

{
"configurations": [
{
"name": "x64-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${projectDir}/../../radium-externals/build/${name}",
"installRoot": "${projectDir}/../../radium-externals/install/${name}",
"cmakeCommandArgs": "-DCMAKE_PREFIX_PATH=C:/Qt/6.3.0/msvc2019_64",
"buildCommandArgs": "",
"ctestCommandArgs": ""
},
{
"name": "x64-Release",
"generator": "Ninja",
"configurationType": "Release",
"buildRoot": "${projectDir}/../../radium-externals/build/${name}",
"installRoot": "${projectDir}/../../radium-externals/install/${name}",
"cmakeCommandArgs": "-DCMAKE_PREFIX_PATH=C:/Qt/6.3.0/msvc2019_64",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ],
"variables": []
}
]
}

Configuration of Radium

To compile Radium-Engine, you have to indicate where cmake can find each dependency.

For convenience, dependencies install procedure create a configuration file, you can use this configuration with the -C option of cmake. The cmake config file /path/to/installs/radium-external-r/radium-options.cmake contains, depending on your dependency configuration:

set(Eigen3_DIR "/path/to/external/install/share/eigen3/cmake/" CACHE PATH "My Eigen3 location")
set(OpenMesh_DIR "/path/to/external/install/share/OpenMesh/cmake/" CACHE PATH "My OpenMesh location")
set(cpplocate_DIR "/path/to/external/install/share/cpplocate/" CACHE PATH "My cpplocate location")
set(nlohmann_json_DIR "/path/to/external/install/lib/cmake/nlohmann_json/" CACHE PATH "My nlohmann_json location")
set(glm_DIR "/path/to/external/install/glm/lib/cmake/glm/" CACHE PATH "My glm location")
set(glbinding_DIR "/path/to/external/install/glbinding/" CACHE PATH "My glbinding location")
set(globjects_DIR "/path/to/external/install/globjects/" CACHE PATH "My globjects location")
set(stb_DIR "/path/to/external/install/include/stb/" CACHE PATH "My stb location")
set(stb_INCLUDE_DIR "/path/to/external/install/include/" CACHE PATH "My stb_INCLUDE location")
set(tinyEXR_DIR "/path/to/external/install/share/tinyEXR/cmake/" CACHE PATH "My tinyEXR location")
set(assimp_DIR "/path/to/external/install/lib/cmake/assimp-5.0/" CACHE PATH "My assimp location")
set(tinyply_DIR "/path/to/external/install/lib/cmake/tinyply/" CACHE PATH "My tinyply location")
set(PowerSlider_DIR "/path/to/external/install/lib/cmake/PowerSlider/" CACHE PATH "My PowerSlider location")
set(RADIUM_IO_ASSIMP ON CACHE BOOL "Radium uses assimp io")
set(RADIUM_IO_TINYPLY ON CACHE BOOL "Radium uses tinyply io")

When configuring Radium cmake project, don't forget to add this file by calling cmake -C /path/to/installs/radium-external-r/radium-options.cmake ...

You can also provide these variables as cmake command line argument:

cmake \
-DEigen3_DIR /path/to/external/install/share/eigen3/cmake/
... and so on ...

User provided external dependencies

You can use your own installation of a local dependency instead of letting cmake fetch and compile it. To this end, just provide the corresponding '*_DIR' to cmake at configuration time as show before (with '-D' option, configuration file or toolchain file, please refer to cmake documentation).

Currently supported (note that these paths must refer to the installation directory of the corresponding library):

  • assimp_DIR
  • tinyply_DIR
  • PowerSlider_DIR
  • glm_DIR
  • glbinding_DIR
  • globjects_DIR
  • stb_DIR
  • tinyEXR_DIR
  • Eigen3_DIR
  • OpenMesh_DIR
  • cpplocate_DIR
  • nlohmann_json_DIR

Radium is compiled and tested with specific version of dependencies, as given in the external's folder CMakeLists.txt and state here for the record

Warning
You have to take care of the consistency of the external dependencies, e.g. it's not possible to use your version of globjects without providing your version of eigen, otherwise you will have mixed version in Radium.