restc-cpp icon indicating copy to clipboard operation
restc-cpp copied to clipboard

CMake package is not relocatable

Open riuriuriu opened this issue 6 years ago • 0 comments

The generated package is not relocatable. The generated restc-cpp.cmake will set absolute paths for INTERFACE_INCLUDE_DIRECTORIES and INTERFACE_LINK_LIBRARIES.

I managed to make it work for my use case by replacing all PUBLIC keywords with PRIVATE in all occurences of target_link_libraries() and target_include_directories(). I'm pretty sure that target_link_libraries() does not need PUBLIC as the linked libraries do not need to end up in the interface. I'm not fully sure about the includes though.

Background: Cross-compiling a package using Yocto.

riuriuriu avatar Mar 13 '19 12:03 riuriuriu