I have a piece of C++ code (several tens of files) linking with ROOT to create a library that can be then loaded in root (gSystem->Load()) and be used, a rootlogon.C file that configure this and a few other things (adding the gSystem->AddIncludePath(), etc).
cmake is used for compilation.
Right now, the code and includes are in a few subdirectories, the rootlogon is just in the main directory, etc. and none of this can really be deployed easily by an end user.
Is there a recommended way to setup such a project directory structure and CMakeList.txt content? A way to have a working “make install” that would put things in a place root would find it easily (ideally under a user prefix some /home/<user>/something)?
What would be best would be a pointer to either some “hello world” (but full featured) example, or a working project having similar goals.
Thanks for any suggestion.
Regards,
Yannick
ROOT Version: Not Provided Platform: Linux Compiler: Not Provided
Welcome to the ROOT Forum!
The directory structure of the project is not really related to the install directory (set by CMAKE_INSTALL_PREFIX). in general, I use a directory for the project (project_name) with a source and a build directory. And here is an example of CMakeLists.txt:
When I cmake and make, I have both libPrj.so and libPrjDict_rdict.pcm
However, when I do a make install only the libPrj.so is copied to <installprefix>/lib.
I read there: https://github.com root-project/root/issues/8308
And tried to put the ROOT_GENERATE_DICTIONARY below, but then I get tons of multiple definition of `ROOT::GenerateInitInstance()'…
There should be exactly one GenerateInitInstance per #pragma link C++ entry in the linkdef file. Can you give a sample of the duplicate symbols and where they are from?