Note that target_sources(PUBLIC FILE_SET headers TYPE HEADERS) can list them and supports installing them (as a fileset) as well. This also ensures they show up in IDEs. Basically, with a fileset, CMake understands that they are headers and can do more with them (like setting up target_include_directories automatically).
1 Like