I have a header-only library:
add_library( "Lib" INTERFACE )
target_sources( "Lib"
INTERFACE
FILE_SET myHeader
TYPE HEADERS
FILES "${CMAKE_CURRENT_SOURCE_DIR}/myHeader.h"
)
and an executable that depends on it:
add_executable( "App" "main.cpp" )
target_link_libraries( "App" PRIVATE "Lib" )
My hope was that since myHeader
was an INTERFACE
FILE_SET
that I could find it (or its files) in the executable’s target properties, similar to how e.g. an include directory from the interface target would be found in the executable’s include directories.
I tried using $<TARGET_PROPERTY:HEADER_SET_myHeader>
and $<TARGET_PROPERTY:HEADER_SET>
on the executable target, but both were empty …
Am I missing something or do INTERFACE
FILE_SET
s not propagate along target dependencies?
(I used a header file to simplify things in the example; my actual use case involves shader files that I’d like to propagate from libraries that own them to the executable that compiles them. And while I can achieve that with custom transitive properties, I was hoping FILE_SET
s would provide a more elegant solution.)