frankaemika / libfranka

C++ library for Franka research robots
https://frankaemika.github.io
Apache License 2.0
221 stars 147 forks source link

Allow `add_subdirectory(...)` builds in CMake, fixes #67 #68

Closed Pascal-So closed 4 years ago

Pascal-So commented 4 years ago

The CMake code previously expected CMAKE_SOURCE_DIR to point to the root of the libfranka source tree, which is not true when libfranka is added to a project using add_subdirectory().

This change does not break the workflow described in the libfranka FAQ, the only difference in the behaviour is for cases that didn't work before.

In the issue #67 I initially suggested using the variable CMAKE_CURRENT_LIST_DIR, but afterwards I decided to use CMAKE_CURRENT_SOURCE_DIR for consistency with existing code in libfranka.