Closed theSoenke closed 7 years ago
It's possible, but try using the makefile for convenience and see if it helps.
make prefix=$HOME/.local install
for example should DTRT.
The Makefile supports the traditional prefix
and DESTDIR
variables. It should work. We just pass the variables along to cmake tho.
https://www.gnu.org/software/make/manual/html_node/DESTDIR.html#DESTDIR
https://www.gnu.org/software/make/manual/html_node/Directory-Variables.html#Directory-Variables
what command were you running?
I just tested this and it works for me so I'm going to close this issue, but if it's not working for you we can reopen it. The steps to approximate what the makefile does are as follows. Let me know if this is what you were running:
# install into the $HOME/.local directory
mkdir -p build/flavor &&
cd build/flavor &&
cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local ../.. &&
make &&
make install
Thanks for testing this. I just noticed that i did run make in the root directory instead of build/flavor. In that case i can build it successfully but the output lands in build/$(FLAVOR) When i instead run make in build/flavor i get an error
[ 98%] Built target imageEditor
make: *** [Makefile:128: all] Error 2
Not sure what the issue is here
if you ran cmake from the root there might be a bunch of cruft left around. Try running from a pristine state: git clean -fdx && git checkout -f
will get it back to the original, unmodified state.
If you then do make prefix=/path/to/where/you/want/it/installed VERBOSE=1
it should print more stuff (though I thought we had verbose enabled by default). You might also want to pass -j 1
so that it doesn't build in parallel, which can help debug compilation errors. The real error is probably somewhere in the log.
Note: make
by itself will only build the temporary build files in your sandbox. make install
is what installs them to the /path/to/where/you/want/it/installed
. The build/$flavor directory is always used for temporary stuff, regardless of where things will be installed.
If you're on Linux or Mac just use the top-level makefile. It's easier. I suspect that cmake replaced the top-level Makefile when you ran it from the root, so follow the steps above to get it back.
Without the CMake generated makefile the build works fine. Thanks for the suggestion. With prefix set the output directory is also correct. Any reason why it's not using DESTDIR? That confused me a little bit
It does support DESTDIR, but the top-level makefile doesn't need to mention it (besides exporting it) because the cmake-generated makefiles have built-in support for DESTDIR; so we just let their generated install target handle it.
deb and rpm packaging typically takes advantage of the DESTDIR stuff. If you find a place where it's not working I'd be happy to help get it rolling
Hi, i have set -DCMAKE_INSTALL_PREFIX for cmake but it seems to be ignored and instead build/$(FLAVOR) is used.
Am i missing something?