vector-of-bool/cmrc

Generate `OBJECT` library instead of `STATIC`

drdanz opened this issue · 1 comments

When installing a STATIC library that includes files using cmrc_add_resource_library, it is necessary to export and install the library generated by CMakeRC as well. This shouldn't be necessary.
An option would be to generate an OBJECT library instead of a STATIC library, and to use it with target_sources and target_include_directories instead of linking it with target_link_libraries

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.