Is there a way to get the CMake macro root_generate_dictionary to name its output files (rootmap and pcm) after the target output name (OUTPUT_NAME target property) instead of the default/current target name itself ?
Thanks
ROOT Version: >= 6.28 Platform: Not relevant Compiler: Not relevant
Well, I have a project specific cmake helper function xxx_add_library which encapsulates a series of steps that one usually have to do to create a library (call cmake own add_library, sets a few properties, create a root dictionary if there’s a linkdef, install the lib, etc…).
In this function I have something like :
where target is computed from some basename (e.g. adding a project-specific prefix), and thus is not the name of the output artifact. Doing so I end up with 3 files installed, e.g. if basename=MyLib and target=prefix-long-name-derived-from-MyLib:
as far as I understand this part of the RootMacros.cmake the problem is that ${library_target_name} is the value of the MODULE parameter given to the macro and not the artifact name (set with OUTPUT_NAME)
An extra question if I may …
Do I understand correctly that the rootmap files are actually no longer needed (since root 6.16 or something) ? (and if that’s indeed the case, then why root_generate_dictionary is generating them) ?
Since then, we have to mode for dictionary. The legacy mode that still require rootmap file and for the header files to present/accessible at run-time. The new C++ module based mode where instead of the rootmap file and header we generate the pre-compiled module file corresponding to those headers. Use the MODULE option to request the new mode.