All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/pkg-cmake.mk: allow cmake packages to have a configurable install prefix
@ 2021-08-30 19:47 Woody Douglass
  2021-08-30 21:16 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Woody Douglass @ 2021-08-30 19:47 UTC (permalink / raw)
  To: buildroot; +Cc: s.martin49


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@carnegierobotics.com>
---
 package/pkg-cmake.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
index 4ee100a0c6..da57a4fe8d 100644
--- a/package/pkg-cmake.mk
+++ b/package/pkg-cmake.mk
@@ -56,6 +56,7 @@ $(2)_CONF_OPTS			?=
 $(2)_MAKE			?= $$(MAKE)
 $(2)_MAKE_ENV			?=
 $(2)_MAKE_OPTS			?=
+$(2)_CMAKE_INSTALL_PREFIX	?= "/usr"
 $(2)_INSTALL_OPTS		?= install
 $(2)_INSTALL_STAGING_OPTS	?= DESTDIR=$$(STAGING_DIR) install/fast
 $(2)_INSTALL_TARGET_OPTS	?= DESTDIR=$$(TARGET_DIR) install/fast
@@ -93,7 +94,7 @@ define $(2)_CONFIGURE_CMDS
 	PATH=$$(BR_PATH) \
 	$$($$(PKG)_CONF_ENV) $$(BR2_CMAKE) $$($$(PKG)_SRCDIR) \
 		-DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/share/buildroot/to
olchainfile.cmake" \
-		-DCMAKE_INSTALL_PREFIX="/usr" \
+		-DCMAKE_INSTALL_PREFIX=$$($$(PKG)_CMAKE_INSTALL_PREFIX)
\
 		-DCMAKE_COLOR_MAKEFILE=OFF \
 		-DBUILD_DOC=OFF \
 		-DBUILD_DOCS=OFF \
-- 
2.20.1
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/pkg-cmake.mk: allow cmake packages to have a configurable install prefix
  2021-08-30 19:47 [Buildroot] [PATCH 1/1] package/pkg-cmake.mk: allow cmake packages to have a configurable install prefix Woody Douglass
@ 2021-08-30 21:16 ` Thomas Petazzoni
  2021-08-31 12:10   ` Woody Douglass
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2021-08-30 21:16 UTC (permalink / raw)
  To: Woody Douglass; +Cc: s.martin49, buildroot

Hello Woody,

On Mon, 30 Aug 2021 19:47:56 +0000
Woody Douglass <wdouglass@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@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
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/pkg-cmake.mk: allow cmake packages to have a configurable install prefix
  2021-08-30 21:16 ` Thomas Petazzoni
@ 2021-08-31 12:10   ` Woody Douglass
  0 siblings, 0 replies; 3+ messages in thread
From: Woody Douglass @ 2021-08-31 12:10 UTC (permalink / raw)
  To: thomas.petazzoni; +Cc: s.martin49, buildroot

That may be true, i'll experiment

Thanks,
Woody

On Mon, 2021-08-30 at 23:16 +0200, Thomas Petazzoni wrote:
> Hello Woody,
> 
> On Mon, 30 Aug 2021 19:47:56 +0000
> Woody Douglass <wdouglass@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@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.cma
> ke" \
>                 -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
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-31 12:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-30 19:47 [Buildroot] [PATCH 1/1] package/pkg-cmake.mk: allow cmake packages to have a configurable install prefix Woody Douglass
2021-08-30 21:16 ` Thomas Petazzoni
2021-08-31 12:10   ` Woody Douglass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.