summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorNikhil Pal Singh <nikhilpal.singh@taitradio.com>2019-04-09 09:24:36 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-04-10 13:46:17 +0100
commitb25ede81df2e43fa2dc8e634f6952de28ed8a0b8 (patch)
treed98517133bbb8be70d0aa47ce7639f3dd4431b91 /meta
parent509963a689b31932cdf22f1709fc8dc2728cb074 (diff)
downloadpoky-b25ede81df2e43fa2dc8e634f6952de28ed8a0b8.tar.gz
cmake: Support Eclipse and other cmake generators
Support project-file generators such as CodeBlocks, CodeLite, Eclipse, Sublime, and Kate for both make and Ninja build systems. The following generators are listed in cmake --help: Unix Makefiles = Generates standard UNIX makefiles. Ninja = Generates build.ninja files. Watcom WMake = Generates Watcom WMake makefiles. CodeBlocks - Ninja = Generates CodeBlocks project files. CodeBlocks - Unix Makefiles = Generates CodeBlocks project files. CodeLite - Ninja = Generates CodeLite project files. CodeLite - Unix Makefiles = Generates CodeLite project files. Sublime Text 2 - Ninja = Generates Sublime Text 2 project files. Sublime Text 2 - Unix Makefiles = Generates Sublime Text 2 project files. Kate - Ninja = Generates Kate project files. Kate - Unix Makefiles = Generates Kate project files. Eclipse CDT4 - Ninja = Generates Eclipse CDT 4.0 project files. Eclipse CDT4 - Unix Makefiles= Generates Eclipse CDT 4.0 project files. All but one of these contain one of the strings, "Unix Makefiles" or "Ninja". In each of these cases, cmake generates the Makefiles (or ninja files respectively), and also the appropriate project files, eg. .project and .cproject for Eclipse. A user can set OECMAKE_GENERATOR in their local.conf to any one of these strings, except "Watcom WMake" (not supported). (From OE-Core rev: 256e8b5deae66b1463c359db12af396702912139) Signed-off-by: Nikhil Pal Singh <nikhilpal.singh@taitradio.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/cmake.bbclass9
1 files changed, 5 insertions, 4 deletions
diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index e16630434e..d3f0d70847 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -10,13 +10,14 @@ OECMAKE_GENERATOR ?= "Ninja"
10 10
11python() { 11python() {
12 generator = d.getVar("OECMAKE_GENERATOR") 12 generator = d.getVar("OECMAKE_GENERATOR")
13 if generator == "Unix Makefiles": 13 if "Unix Makefiles" in generator:
14 args = "-G 'Unix Makefiles' -DCMAKE_MAKE_PROGRAM=" + d.getVar("MAKE") 14 args = "-G '" + generator + "' -DCMAKE_MAKE_PROGRAM=" + d.getVar("MAKE")
15 d.setVar("OECMAKE_GENERATOR_ARGS", args) 15 d.setVar("OECMAKE_GENERATOR_ARGS", args)
16 d.setVarFlag("do_compile", "progress", "percent") 16 d.setVarFlag("do_compile", "progress", "percent")
17 elif generator == "Ninja": 17 elif "Ninja" in generator:
18 args = "-G '" + generator + "' -DCMAKE_MAKE_PROGRAM=ninja"
18 d.appendVar("DEPENDS", " ninja-native") 19 d.appendVar("DEPENDS", " ninja-native")
19 d.setVar("OECMAKE_GENERATOR_ARGS", "-G Ninja -DCMAKE_MAKE_PROGRAM=ninja") 20 d.setVar("OECMAKE_GENERATOR_ARGS", args)
20 d.setVarFlag("do_compile", "progress", r"outof:^\[(\d+)/(\d+)\]\s+") 21 d.setVarFlag("do_compile", "progress", r"outof:^\[(\d+)/(\d+)\]\s+")
21 else: 22 else:
22 bb.fatal("Unknown CMake Generator %s" % generator) 23 bb.fatal("Unknown CMake Generator %s" % generator)