rizsotto / Bear

Bear is a tool that generates a compilation database for clang tooling.
GNU General Public License v3.0
4.76k stars 312 forks source link

Add support for $CMAKE_INSTALL_PREFIX #454

Closed ton closed 2 years ago

ton commented 2 years ago

I work on a system where I do not have privileges to install tools to /usr/local. So I build and installed Bear using $CMAKE_INSTALL_PREFIX set to $HOME/.local.

By default, Bear will still look in /usr/local for its runtime dependencies. It would be nice if this was not hardcoded but somehow compiled into the binary. I noticed that it is possible to set all these paths through the command-line, so there is a workaround. It is a bit inconvenient still since all the runtime dependencies have to be told to look at a certain path, instead of having one command-line option to tell Bear to look for its runtime dependencies relative to some fixed path.

rizsotto commented 2 years ago

I am using this command for a long time, and it works just fine. (It's a Fedora where the library directory is lib64, but that might be different for debian derived distros. Read the INSTALL.md section about it.)

cmake ... -DCMAKE_INSTALL_PREFIX:PATH=... -DCMAKE_INSTALL_LIBDIR=lib64