Ideally, I’d like to define the variable ${headers_list} from a loop. I tried using a big string with all file names in quotes, I tried a list. However, I can’t find the proper way to do it so that it works.
Is there a way to do that?
Thanks a lot for your help!
All the best,
Julien
_ROOT Version: 6.24.06
_Platform: Mac OS 11.6.3
_Compiler: clang-1300.0.29.3
Thanks for your answer. This solution however seems not to work when used with ROOT_GENERATE_DICTIONARY.
I found a way around by renaming the LinkDef header to LinkDef.hh (with extension hh instead of simply h), and using
That way, the LinkDef.hh file is not included in ${header_files}.
The question still remains: how could I build a custom ${header_files} list, possibly using a loop? Or how to build a list of header files which would behave the same way as file(GLOB …)?
If I have 20 header files, it would mean 20 lines in the CMake file, and I don’t want that.
I think now that using different extensions like .h if I want to include the header file in the dictionary generation, and .hh if I don’t is probably the best solution. And contrary to the list(APPEND…) method, I don"t need to modify the CMakeLists file each time I add a new header.