FlashMQ icon indicating copy to clipboard operation
FlashMQ copied to clipboard

Flashmq ignores CMAKE_INSTALL_PREFIX

Open billpriest opened this issue 1 year ago • 4 comments

When crosscompiling I specified the CMAKE_INSTALL_PREFIX on the command line cmake -DCMAKE_INSTALL_PREFIX=/opt/flashmq ../Flashmq make sudo make install

The install step installed as follows -- Install configuration: "" -- Up-to-date: /usr/bin/flashmq -- Up-to-date: /var/lib/flashmq -- Up-to-date: /var/log/flashmq -- Up-to-date: /etc/flashmq/flashmq.conf -- Up-to-date: /lib/systemd/system/flashmq.service -- Up-to-date: /usr/share/man/man5/flashmq.conf.5 -- Up-to-date: /usr/share/man/man1/flashmq.1

billpriest avatar Aug 30 '24 14:08 billpriest

I'm looking into it, but the cmake CMAKE_INSTALL_PREFIX world is a treacherous one, apparently.

A problem is the systemd file, whose content needs to change for a different path.

Also, I'm not quite sure what to do with /etc, /var/log and /var/lib. Cmake has variables for them that put them in /usr/local, but using those dirs seems uncommon. The whole concept of 'local install' is dodgy anyway.

BTW, you're building a slow debug build.

halfgaar avatar Sep 01 '24 11:09 halfgaar

Since I am crosscompiling my install scripts typically transform paths in the tarball to put the files in the "correct" place on the target system as opposed to having to change "default paths" of the services and configuration files. I'm not sure what other people that crosscompile do; so modifying the systemd files wasn't required.

billpriest avatar Sep 03 '24 16:09 billpriest

have a look at https://cmake.org/cmake/help/latest/envvar/DESTDIR.html

or DESTDIR="/path/to/.." cmake --install

jhofstee avatar Apr 07 '25 09:04 jhofstee

@halfgaar see https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html btw

jhofstee avatar Apr 07 '25 09:04 jhofstee