orocos-toolchain / rtt

Orocos Real-Time Toolkit
http://www.orocos.org
Other
72 stars 79 forks source link

Fix cmake and linking errors for CMake 3.3 and above #313

Open meyerj opened 4 years ago

meyerj commented 4 years ago

This fixes a linker error with CMake 3.5.1, which as a result of

target_link_libraries(orocos-rtt-${OROCOS_TARGET}_dynamic /full/path/to/orocos_ws/install/liblog4cpp.so)

adds

-llog4cpp

to the linker command line because the library path is considered as an implicit link directory.

It is not, and that's why the linker fails to find log4cpp on my Xenial system:

/usr/bin/ld: cannot find -llog4cpp

Not sure why the catkin install-space inside the home directory is considered as an implicit link directory by CMake 3.5.1. Might be a bug.

Solution: