From patchwork Wed Feb 25 19:18:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gwenhael Goavec-Merou X-Patchwork-Id: 443620 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 747D61400B6 for ; Thu, 26 Feb 2015 06:17:07 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C0BAA920C9; Wed, 25 Feb 2015 19:17:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZgKNGAWy1HvK; Wed, 25 Feb 2015 19:17:03 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 1679D920E8; Wed, 25 Feb 2015 19:16:57 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 8CB7D1BFAA7 for ; Wed, 25 Feb 2015 19:16:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 87C07920AC for ; Wed, 25 Feb 2015 19:16:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id k8C6INICtAEO for ; Wed, 25 Feb 2015 19:16:47 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from smtp2-g21.free.fr (smtp2-g21.free.fr [212.27.42.2]) by whitealder.osuosl.org (Postfix) with ESMTPS id 1B8AE920AB for ; Wed, 25 Feb 2015 19:16:46 +0000 (UTC) Received: from x230.trabucayre.com (unknown [81.56.132.22]) by smtp2-g21.free.fr (Postfix) with ESMTP id 137D44B018B; Wed, 25 Feb 2015 20:16:26 +0100 (CET) From: Gwenhael Goavec-Merou To: buildroot@busybox.net Date: Wed, 25 Feb 2015 20:18:31 +0100 Message-Id: <1424891914-27748-1-git-send-email-gwenj@trabucayre.com> X-Mailer: git-send-email 2.0.5 Cc: Thomas Petazzoni , Gwenhael Goavec-Merou Subject: [Buildroot] [PATCH v2 1/4] pkg-cmake: allow to build package in a subdirectory X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Gwenhael Goavec-Merou For some cmake based packages, like GNURadio, it's forbidden to do the compilation directly in the sources directory. This patch add a new variable to specify, if needed, the name of a sub-directory used to compile. Signed-off-by: Gwenhael Goavec-Merou Tested-by: Samuel Martin Acked-by: Samuel Martin --- Changes v1 -> v2: * Allow to overload $(2)_BUILDDIR instead of adding a new variable and test --- package/pkg-cmake.mk | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk index eacd641..f3bd080 100644 --- a/package/pkg-cmake.mk +++ b/package/pkg-cmake.mk @@ -57,7 +57,7 @@ $(2)_INSTALL_STAGING_OPTS ?= DESTDIR=$$(STAGING_DIR) install $(2)_INSTALL_TARGET_OPTS ?= DESTDIR=$$(TARGET_DIR) install $(2)_SRCDIR = $$($(2)_DIR)/$$($(2)_SUBDIR) -$(2)_BUILDDIR = $$($(2)_SRCDIR) +$(2)_BUILDDIR ?= $$($(2)_SRCDIR) # # Configure step. Only define it if not already defined by the package @@ -69,7 +69,8 @@ ifeq ($(4),target) # Configure package for target define $(2)_CONFIGURE_CMDS - (cd $$($$(PKG)_BUILDDIR) && \ + (mkdir -p $$($$(PKG)_BUILDDIR) && \ + cd $$($$(PKG)_BUILDDIR) && \ rm -f CMakeCache.txt && \ PATH=$$(BR_PATH) \ $$($$(PKG)_CONF_ENV) $$(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \ @@ -93,7 +94,8 @@ else # Configure package for host define $(2)_CONFIGURE_CMDS - (cd $$($$(PKG)_BUILDDIR) && \ + (mkdir -p $$($$(PKG)_BUILDDIR) && \ + cd $$($$(PKG)_BUILDDIR) && \ rm -f CMakeCache.txt && \ PATH=$$(BR_PATH) \ $$(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \