summaryrefslogtreecommitdiff
path: root/package/Makefile.cmake.in
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2011-09-29 21:57:44 +0200
committerPeter Korsgaard <jacmet@sunsite.dk>2011-09-29 23:14:34 +0200
commit9e4aeb3c2b92435f406ff165965475ba774705d0 (patch)
treefa73e351d06c0b8edacd2063834b2b8563a91c2f /package/Makefile.cmake.in
parent300f9c9c9dcf2b47ea89c45d5b1ea05e7305bd49 (diff)
package: remove useless arguments from CMAKETARGETS
Thanks to the pkgparentdir and pkgname functions, we can rewrite the GENTARGETS macro in a way that avoids the need for each package to repeat its name and the directory in which it is present. [Peter: pkgdir->pkgparentdir] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package/Makefile.cmake.in')
-rw-r--r--package/Makefile.cmake.in10
1 files changed, 4 insertions, 6 deletions
diff --git a/package/Makefile.cmake.in b/package/Makefile.cmake.in
index 1263eb993..38e459b80 100644
--- a/package/Makefile.cmake.in
+++ b/package/Makefile.cmake.in
@@ -183,15 +183,13 @@ endef
################################################################################
# CMAKETARGETS -- the target generator macro for CMake packages
#
-# Argument 1 is the package directory prefix [mandatory]
-# Argument 2 is the lowercase package name [mandatory]
-# Argument 3 is "target" or "host" [optional, default: "target"]
+# Argument 1 is "target" or "host" [optional, default: "target"]
################################################################################
define CMAKETARGETS
-ifeq ($(3),host)
-$(call CMAKETARGETS_INNER,$(3)-$(2),$(call UPPERCASE,$(3)-$(2)),$(call UPPERCASE,$(2)),$(1),host)
+ifeq ($(1),host)
+$(call CMAKETARGETS_INNER,$(1)-$(call pkgname),$(call UPPERCASE,$(1)-$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgparentdir),host)
else
-$(call CMAKETARGETS_INNER,$(2),$(call UPPERCASE,$(2)),$(call UPPERCASE,$(2)),$(1),target)
+$(call CMAKETARGETS_INNER,$(call pkgname),$(call UPPERCASE,$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgparentdir),target)
endif
endef