kzampog / cilantro

A lean C++ library for working with point cloud data
MIT License
1.01k stars 206 forks source link

Linked libraries do not propagate properly to client projects #37

Closed Algomorph closed 4 years ago

Algomorph commented 4 years ago

The dependency propagation mechanism from cilantro to client projects is based on Pangolin.

Unfortunately, the Eigen and Pangolin dependencies don't seem to propagate. If we compare the PangolinTargets.cmake file to the cilantroTargets.cmake file (both of which are generated and copied to the install location, inside /lib/cmake/{cilantro or Pangolin}/), here is what we see.

PangolinTargets.cmake (lines 56-60):

set_target_properties(pangolin PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "/usr/include;/usr/include;/usr/include;/usr/include/eigen3;${_IMPORT_PREFIX}/include"
  INTERFACE_LINK_LIBRARIES "/usr/lib/x86_64-linux-gnu/libGL.so;/usr/lib/x86_64-linux-gnu/libGLU.so;/usr/lib/x86_64-linux-gnu/libGLEW.so;/usr/lib/x86_64-linux-gnu/libEGL.so;/usr/lib/x86_64-linux-gnu/libwayland-client.so;/usr/lib/x86_64-linux-gnu/libwayland-egl.so;/usr/lib/x86_64-linux-gnu/libwayland-cursor.so;EGL;xkbcommon;/usr/lib/x86_64-linux-gnu/libSM.so;/usr/lib/x86_64-linux-gnu/libICE.so;/usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so;rt;pthread"
  INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "/usr/include;/usr/include;/usr/include;/usr/include/eigen3"
)

Corresponding lines for cilantroTargets.cmake (line 56-58):

set_target_properties(cilantro PROPERTIES
  INTERFACE_COMPILE_OPTIONS "-O3;-march=native;-mtune=native;-fopenmp"
)

Hence, we're obviously missing some important stuff, like Pangolin itself and its dependencies. Something small must be missing in the cilantro's CMakeLists.txt, not sure yet what.

kzampog commented 4 years ago

Dear Mr. Hedgehog,

Kindly take a look at latest commit :-) (it seems to be behaving correctly now)

Algomorph commented 4 years ago

Thank you very much, Mr. Greek God of Computer Vision :-) Indeed, seems to be working now (tested on Ubuntu 18 only, though).

kzampog commented 4 years ago

Closing this for now, feel free to revisit if something misbehaves :)