CauldronDevelopmentLLC / CAMotics

Open-Source Simulation & Computer Aided Machining - A 3-axis CNC GCode simulator
Other
602 stars 140 forks source link

Prepare camotics for building AppImage #316

Closed koendv closed 4 years ago

koendv commented 4 years ago

Hi. AppImage is a way to distribute software as a single file. Inside the appimage there's a compressed filesystem, which contains not only the executeable, but also all libraries and resource files needed. At runtime, this filesystem gets mounted under /tmp. Your binary might be at /tmp/.mount12345/usr/bin/camotics, with some files at /tmp/.mount12345/usr/share/camotics, and others at /tmp/.mount12345/usr/share/doc/camotics. I made a camotics appimage but unfortunately, camotics keeps looking for files in /usr/share/ , defeating the purpose of an appimage.

I've been looking at how prusa-slicer handles this. prusa-slicer looks for a resource directory relative to its binary, like this: (in PrusaSlicer.cpp)

boost::filesystem::path path_to_binary = boost::filesystem::system_complete(argv[0]);
boost::filesystem::path path_resources = path_to_binary.parent_path() / "../resources";

Just FYI.

jcoffland commented 4 years ago

Done.

koendv commented 4 years ago

Thanks. Built. On x86 you might want to look at linuxdeployqt.

jcoffland commented 4 years ago

Thanks. I'm already using the macOS equivalent.