Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Bjørn Forsman" <bjorn.forsman@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 3/4] Makefile: generate CMake toolchain file in $(O)
Date: Sun, 12 Dec 2010 20:29:14 +0100	[thread overview]
Message-ID: <1292182155-29576-4-git-send-email-bjorn.forsman@gmail.com> (raw)
In-Reply-To: <1292182155-29576-1-git-send-email-bjorn.forsman@gmail.com>

A CMake toolchain file makes it easy to develop CMake-based packages
outside of Buildroot. Just give the toolchain file path to CMake via the
-DCMAKE_TOOLCHAIN_FILE=... option.

Signed-off-by: Bj?rn Forsman <bjorn.forsman@gmail.com>
---
 Makefile |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 7d6e4af..0cf49d4 100644
--- a/Makefile
+++ b/Makefile
@@ -358,7 +358,7 @@ $(TARGETS_ALL): __real_tgt_%: $(BASE_TARGETS) %
 dirs: $(DL_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \
 	$(HOST_DIR) $(BR2_DEPENDS_DIR) $(BINARIES_DIR) $(STAMP_DIR)
 
-$(BASE_TARGETS): dirs
+$(BASE_TARGETS): dirs $(O)/toolchainfile.cmake
 
 $(BUILD_DIR)/buildroot-config/auto.conf: $(CONFIG_DIR)/.config
 	$(MAKE) $(EXTRAMAKEARGS) silentoldconfig
@@ -367,6 +367,16 @@ prepare: $(BUILD_DIR)/buildroot-config/auto.conf
 
 world: prepare dependencies dirs $(BASE_TARGETS) $(TARGETS_ALL)
 
+$(O)/toolchainfile.cmake:
+	@echo -en "\
+	set(CMAKE_SYSTEM_NAME Linux)\n\
+	set(CMAKE_C_COMPILER $(CMAKE_TARGET_CC))\n\
+	set(CMAKE_CXX_COMPILER $(CMAKE_TARGET_CXX))\n\
+	set(CMAKE_FIND_ROOT_PATH $(STAGING_DIR))\n\
+	set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)\n\
+	set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)\n\
+	set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)\n\
+	" > $@
 
 .PHONY: all world dirs clean distclean source outputmakefile \
 	$(BASE_TARGETS) $(TARGETS) $(TARGETS_ALL) \
-- 
1.7.1

  parent reply	other threads:[~2010-12-12 19:29 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-12 19:29 [Buildroot] [PATCH 0/4] Introducing CMAKETARGETS infrastructure Bjørn Forsman
2010-12-12 19:29 ` [Buildroot] [PATCH 1/4] Add CMAKETARGETS infrastructure for CMake packages Bjørn Forsman
2010-12-13 22:27   ` Samuel Martin
2010-12-14 11:13     ` Bjørn Forsman
2010-12-22 21:34       ` Samuel Martin
2010-12-23  7:46         ` Thomas Petazzoni
2010-12-23  8:46           ` Bjørn Forsman
2010-12-23  8:54             ` Thomas Petazzoni
2010-12-23  9:14               ` Bjørn Forsman
2011-01-07 17:17   ` Thomas Petazzoni
2011-01-08 23:44     ` Bjørn Forsman
2011-01-10 17:51   ` Thomas Petazzoni
2011-01-10 20:14     ` Bjørn Forsman
2010-12-12 19:29 ` [Buildroot] [PATCH 2/4] doc: add CMAKETARGETS documentation Bjørn Forsman
2010-12-12 19:29 ` Bjørn Forsman [this message]
2010-12-13 22:27   ` [Buildroot] [PATCH 3/4] Makefile: generate CMake toolchain file in $(O) Samuel Martin
2010-12-14 12:39     ` Bjørn Forsman
2010-12-22 21:32       ` Samuel Martin
2010-12-23  7:48         ` Thomas Petazzoni
2010-12-24 12:25           ` Samuel Martin
2010-12-23  9:04         ` Bjørn Forsman
2010-12-24 12:26           ` Samuel Martin
2011-01-07 17:15   ` Thomas Petazzoni
2011-01-08 23:42     ` Bjørn Forsman
2011-01-09 12:52     ` Bjørn Forsman
2011-01-09 14:08       ` Thomas Petazzoni
2011-01-10 17:50     ` Thomas Petazzoni
2011-01-10 18:30       ` Bjørn Forsman
2011-01-10 22:28         ` Thomas Petazzoni
2011-01-11 10:22         ` Thomas Petazzoni
2011-01-11 10:27           ` Thomas Petazzoni
2011-01-15 13:50           ` Bjørn Forsman
2010-12-12 19:29 ` [Buildroot] [PATCH 4/4] cdrkit: convert to CMAKETARGETS infrastructure Bjørn Forsman
2010-12-13 22:28   ` Samuel Martin

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=1292182155-29576-4-git-send-email-bjorn.forsman@gmail.com \
    --to=bjorn.forsman@gmail.com \
    --cc=buildroot@busybox.net \
    /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