Building a ROOT dictionary using CMake


I have some simulation code written using Géant and ROOT. Previously, it was built using a GNUMakefile (by a former graduate student), but since Géant updated it’s version, it now needs to be compiled with CMake. I have managed to write a CMake file for the most part. However, my code contained a ROOT dictionary which I am now trying to build with CMake. I believe I understand how to write a cmake file to build code which uses ROOT. My problem is trying to build the ROOT dictionaries. I have attached the CMakeLists.txt file which I am using in addition to the error which I am getting. It is clear to me that there is a problem with linking the ROOT dictionary to the ROOT libraries, but I was not able to find much documentation on integrating ROOT dictionaries into Cmake. I also attached the GNUMakefile from the original code. If anyone has any suggestions (even if it’s just redirecting me to a place where there might be more documentation on this), I would truly appreciate it. Thank you.


GNUmakefile.txt (2.1 KB)
CMakeLists.txt (2.97 KB)


a good start could be to see how dictionaries are built for root.
The file is cmake/modules/RootNewMacros.cmake and the CMake function ROOT_GENERATE_DICTIONARY.