CMake error when installing Damaris with Catalyst support due to OSMesa
This issue is found when installing Damaris with Paraview support:
cmake ../../damaris-prod/damaris -DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_COMPILER=$MPICXX \
-DCMAKE_C_COMPILER=$MPICC \
-DENABLE_HDF5=ON -DHDF5_ROOT=$HDF5_DIR \
-DENABLE_CATALYST=ON \
-DParaView_DIR=$PROJECTSCRATCH/local/lib64/cmake/paraview-5.11
...
CMake Error at /scratch/project/dd-23-66/local/lib64/cmake/paraview-5.11/vtk/VTK-targets.cmake:583 (set_target_properties):
The link interface of target "VTK::opengl" contains:
OSMesa::OSMesa
but the target was not found.
A fix is to add RenderingOpenGL2 to the find_package(VTK COMPONENTS ...) in the root CMakeLists.txt
The same addition (RenderingOpenGL2 ) will also be needed to lib/DaamrisConfig.cmake.in in find_package(VTK COMPONENTS ...).
We will try to automate this addition sometime, if possible.