I’m trying to have a project that depends on ROOT compile with cmake. I created a CMakeLists.txt file that uses root_generate_dictionary to create all the needed dictionaries, but I don’t want them to end up in the main build directory but rather have them show up in a sub-directory. Using CMAKE_LIBRARY_OUTPUT_DIRECTORY redirects where the libraries, rootmap, and pcm files are generated, but it does not affect the G__.cxx files. How can I make sure that these files are also put in a subdirectory (same one as the libraries or a different one)?
I see, so there is no way to move these files out of the main build directory. Because using file(COPY ...) and file(REMOVE ...) would cause the next make to simply re-build it.
It does clutter up the build directory quite a lot (there are 22 dictionaries being built), which doesn’t seem to be in line with the normal behavior of cmake which hides all the intermediate files in the CMakeFiles directory. I just wanted to make certain I didn’t miss any obvious option to hide those files.
Yes, that would probably work. I have a sub-library that is included using FetchContent and the dictionaries of this library are in the _deps/<library-name>-build directory.