1
0
mirror of https://github.com/ohwgiles/laminar.git synced 2026-03-02 03:40:21 +00:00

cmake: more appropriate use of CMAKE_INSTALL_PREFIX

CMAKE_INSTALL_PREFIX is supposed to be used to set an install prefix
of e.g. /usr or /usr/local. Because we need to install files to /etc,
we had been requiring CMAKE_INSTALL_PREFIX=/ and installing using
relative paths.

The best practice method is to install to /etc using absolute paths,
and then allow CMAKE_INSTALL_PREFIX to set where the final binaries
actually go. Now that it actually has some meaning, the systemd
service is generated to incorporate that path.

Those wishing to use "make install" to install laminar to a subdir
should use "make DESTDIR=path/to/subdir install" and NOT modify
CMAKE_INSTALL_PREFIX.

Documentation and packaging scripts updated accordingly.
This commit is contained in:
Oliver Giles
2020-06-20 15:59:35 +12:00
parent de948c149e
commit 1bb545e3f9
8 changed files with 16 additions and 14 deletions

View File

@@ -54,7 +54,7 @@ Lightweight Continuous Integration Service
%prep
%build
cmake3 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/ -DSYSTEMD_UNITDIR=%{_unitdir} %{_sourcedir}/laminar-$VERSION
cmake3 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DSYSTEMD_UNITDIR=%{_unitdir} %{_sourcedir}/laminar-$VERSION
pwd
make

View File

@@ -51,7 +51,7 @@ Lightweight Continuous Integration Service
%prep
%build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/ -DSYSTEMD_UNITDIR=%{_unitdir} %{_sourcedir}/laminar-$VERSION
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DSYSTEMD_UNITDIR=%{_unitdir} %{_sourcedir}/laminar-$VERSION
pwd
make

View File

@@ -17,7 +17,7 @@ docker run --rm -i -v $SOURCE_DIR:/laminar:ro -v $OUTPUT_DIR:/output $DOCKER_TAG
mkdir /build
cd /build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/ -DZSH_COMPLETIONS_DIR=/usr/share/zsh/functions/Completion/Unix /laminar
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DZSH_COMPLETIONS_DIR=/usr/share/zsh/functions/Completion/Unix /laminar
make -j4
mkdir laminar
make DESTDIR=laminar install/strip

View File

@@ -30,7 +30,7 @@ cmake \
-DCMAKE_OBJCOPY=/usr/bin/arm-linux-gnueabihf-objcopy \
-DCMAKE_STRIP=/usr/bin/arm-linux-gnueabihf-strip \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/ \
-DCMAKE_INSTALL_PREFIX=/usr \
-DZSH_COMPLETIONS_DIR=/usr/share/zsh/functions/Completion/Unix \
/laminar
make -j4