mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Marian Cichy <m.cichy@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Marian Cichy <m.cichy@pengutronix.de>
Subject: [ptxdist] [PATCH v2 2/7] OpenCV: Added flag to build and integrate Examples
Date: Thu, 23 Jan 2020 15:23:10 +0100	[thread overview]
Message-ID: <20200123142315.10466-2-m.cichy@pengutronix.de> (raw)
In-Reply-To: <20200123142315.10466-1-m.cichy@pengutronix.de>

Signed-off-by: Marian Cichy <m.cichy@pengutronix.de>
---
 rules/opencv.in   |  5 +++++
 rules/opencv.make | 21 ++++++++++++++++++---
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/rules/opencv.in b/rules/opencv.in
index 37fd32758..ac096d60c 100644
--- a/rules/opencv.in
+++ b/rules/opencv.in
@@ -131,4 +131,9 @@ config OPENCV_QT
 	help
 	  QT GUI Support
 
+config OPENCV_EXAMPLES
+	bool
+	prompt "Build Examples"
+	help
+	  Build the OpenCV example applications and install them into /usr/share/opencv/examples.
 endif
diff --git a/rules/opencv.make b/rules/opencv.make
index 44ee4fd0c..0ae4776d2 100644
--- a/rules/opencv.make
+++ b/rules/opencv.make
@@ -39,7 +39,7 @@ OPENCV_CONF_OPT		:= \
 	-DANT_EXECUTABLE:FILEPATH= \
 	-DPYTHON_EXECUTABLE= \
 	-DBUILD_DOCS:BOOL=OFF \
-	-DBUILD_EXAMPLES:BOOL=OFF \
+	-DBUILD_EXAMPLES:BOOL=$(call ptx/onoff, PTXCONF_OPENCV_EXAMPLES) \
 	-DBUILD_PACKAGE:BOOL=OFF \
 	-DCMAKE_BUILD_TYPE=Release \
 	-DBUILD_SHARED_LIBS:BOOL=ON \
@@ -122,6 +122,20 @@ OPENCV_CONF_OPT		:= \
 	-DWITH_OPENGL:BOOL=OFF \
 	-DWITH_QT:BOOL=$(call ptx/ifdef,PTXCONF_OPENCV_QT,4,OFF)
 
+
+OPENCV_BUILD_DIR := $(OPENCV_DIR)-build
+
+$(STATEDIR)/opencv.install:
+	@$(call targetinfo)
+	@$(call world/install, OPENCV)
+ifdef PTXCONF_OPENCV_EXAMPLES
+	@mkdir -p $(OPENCV_PKGDIR)/usr/share/opencv/examples
+	find $(OPENCV_BUILD_DIR)/bin -type f | while read file; do \
+	install -v -m 755 "$$file" $(OPENCV_PKGDIR)/usr/share/opencv/examples; \
+	done
+endif
+	@$(call touch)
+
 # ----------------------------------------------------------------------------
 # Target-Install
 # ----------------------------------------------------------------------------
@@ -153,9 +167,10 @@ $(STATEDIR)/opencv.targetinstall:
 
 	@$(foreach lib, $(OPENCV_LIBS-y), \
 		$(call install_lib, opencv, 0, 0, 0644, $(lib));)
-
+ifdef PTXCONF_OPENCV_EXAMPLES
+	$(call install_tree, opencv, 0, 0, - , /usr/share/opencv/examples)
+endif
 	@$(call install_finish, opencv)
-
 	@$(call touch)
 
 # vim: syntax=make
-- 
2.20.1


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

  reply	other threads:[~2020-01-23 14:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-23 14:23 [ptxdist] [PATCH v2 1/7] OpenCV: Update to Version 4.1.2 Marian Cichy
2020-01-23 14:23 ` Marian Cichy [this message]
2020-01-23 14:23 ` [ptxdist] [PATCH v2 3/7] OpenCV: Clean up configure_helper output Marian Cichy
2020-01-23 14:23 ` [ptxdist] [PATCH v2 4/7] OpenCV: Changed QT-Support from 4 to 5 Marian Cichy
2020-01-23 14:23 ` [ptxdist] [PATCH v2 5/7] OpenCV: added switch to turn on/off DNN support Marian Cichy
2020-01-23 14:23 ` [ptxdist] [PATCH v2 6/7] OpenCV: changed ptx/ifdef usage to ptx/onoff Marian Cichy
2020-01-23 14:23 ` [ptxdist] [PATCH v2 7/7] OpenCV: fix download in PTXDist prepare stage Marian Cichy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200123142315.10466-2-m.cichy@pengutronix.de \
    --to=m.cichy@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox