[Buildroot] [PATCH 1/1] package/pkg-cmake.mk: allow cmake packages to have a configurable install prefix

Thomas Petazzoni thomas.petazzoni at bootlin.com
Mon Aug 30 21:16:33 UTC 2021


Hello Woody,

On Mon, 30 Aug 2021 19:47:56 +0000
Woody Douglass <wdouglass at carnegierobotics.com> wrote:

> I like to organize binaries on my system so that proprietary stuff
> is put under the /opt tree. this patch allows for that.
> 
> Signed-off-by: Woodrow Douglass <wdouglass at carnegierobotics.com>

Can't you just pass:

<pkg>_CONF_OPTS = -DCMAKE_INSTALL_PREFIX=/opt

in your own package ?

<pkg>_CONF_OPTS is used as follows:

        $$($$(PKG)_CONF_ENV) $$(BR2_CMAKE) $$($$(PKG)_SRCDIR) \
                -DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/share/buildroot/toolchainfile.cmake" \
                -DCMAKE_INSTALL_PREFIX="/usr" \
                -DCMAKE_COLOR_MAKEFILE=OFF \
                -DBUILD_DOC=OFF \
                -DBUILD_DOCS=OFF \
                -DBUILD_EXAMPLE=OFF \
                -DBUILD_EXAMPLES=OFF \
                -DBUILD_TEST=OFF \
                -DBUILD_TESTS=OFF \
                -DBUILD_TESTING=OFF \
                -DBUILD_SHARED_LIBS=$$(if $$(BR2_STATIC_LIBS),OFF,ON) \
                $$(CMAKE_QUIET) \
                $$($$(PKG)_CONF_OPTS) \

Since it appears *after* -DCMAKE_INSTALL_PREFIX="/usr" I assume your
own -DCMAKE_INSTALL_PREFIX=/opt would take precedence.

Best regards,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


More information about the buildroot mailing list