I am new to snapcraft but I really like the idea and simple configuration method.
I am trying to build a snap for my application but I can’t fix an apparently simple problem.
I checked similar topics but couldn’t figure out a working solution in my case.
Situation is this:
package A and package B.
A is built with cmake (an external library), B with catkin (application).
I can build correctly package A, but package B (which depends on A) doesn’t see package A correctly installed within the snap space (I imagine). I get errors at compile time for wrong or missing A library.
I tried to use the after: [A] and messing around with A installation path, but still can’t figure out a working configuration.
What am I missing? Is there a way to tell package B where to look for A?
I am telling A to install in -DCMAKE_INSTALL_PREFIX=$SNAPCRAFT_PART_INSTALL/ and related subdirectories.
Usually on my pc I install A in /usr/local.
Any idea or suggestion on this?
Any help is greatly appreciated.
I believe this is your issue. When snapcraft runs the make install step it will pass DESTDIR=$SNAPCRAFT_PART_INSTALL as a setting which will cause your files to be staged into $SNAPCRAFT_PART_INSTALL/$SNAPCRAFT_PART_INSTALL. You probably want to specify -DCMAKE_INSTALL_PREFIX=/usr and let the magic happen under the hood.
I took these instructions from cartographer build instructions.
With the instructions typed in manually I can compile the package. But when doing snapcraft I always get stuck when building the last package (cartographer), with errors on protobuf versions.
If I specify -DCMAKE_INSTALL_PREFIX=/ the libs get installed in host computer / folder (sudoing, error otherwise), not in the snap space.