Closed drdanz closed 3 years ago
Actually after a few tests, I think that instead of
target_link_libraries(my-program PRIVATE foo::rc)
it is already possible to use
target_sources(my-program PRIVATE $<TARGET_OBJECTS:foo::rc>)
target_include_directories(my-program PRIVATE $<TARGET_PROPERTY:foo::rc,INTERFACE_INCLUDE_DIRECTORIES>)
even if this is a static library.
If I understand correctly, the only difference is that using OBJECT
will not create an actual static library.
When installing a
STATIC
library that includes files usingcmrc_add_resource_library
, it is necessary to export and install the library generated byCMakeRC
as well. This shouldn't be necessary. An option would be to generate anOBJECT
library instead of aSTATIC
library, and to use it withtarget_sources
andtarget_include_directories
instead of linking it withtarget_link_libraries