INTERFACE_POSITION_INDEPENDENT_CODE is not transitive to 'OBJECT' libraries
ADD_LIBRARY ( accessor OBJECT attributeheader.cpp accessor.cpp ... )
add_library ( pic_on INTERFACE )
set_property ( TARGET pic_on PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE ON )
target_link_libraries ( accessor PRIVATE pic_on)
Doesnt produce '-fPIC' when compiling accessor object. Another properties (compiler definitions, options) are still transitive.
As runaround now I use:
get_target_property ( pic pic_on INTERFACE_POSITION_INDEPENDENT_CODE )
set_property ( TARGET accessor PROPERTY POSITION_INDEPENDENT_CODE ${pic} )
This explicit copying from intefrace property achieves desired result.
Also, if I change type of the library from 'OBJECT' to 'STATIC' or 'SHARED' - transition works well.