From b25ede81df2e43fa2dc8e634f6952de28ed8a0b8 Mon Sep 17 00:00:00 2001 From: Nikhil Pal Singh Date: Tue, 9 Apr 2019 09:24:36 +1200 Subject: 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 Signed-off-by: Richard Purdie --- meta/classes/cmake.bbclass | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'meta') 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" python() { generator = d.getVar("OECMAKE_GENERATOR") - if generator == "Unix Makefiles": - args = "-G 'Unix Makefiles' -DCMAKE_MAKE_PROGRAM=" + d.getVar("MAKE") + if "Unix Makefiles" in generator: + args = "-G '" + generator + "' -DCMAKE_MAKE_PROGRAM=" + d.getVar("MAKE") d.setVar("OECMAKE_GENERATOR_ARGS", args) d.setVarFlag("do_compile", "progress", "percent") - elif generator == "Ninja": + elif "Ninja" in generator: + args = "-G '" + generator + "' -DCMAKE_MAKE_PROGRAM=ninja" d.appendVar("DEPENDS", " ninja-native") - d.setVar("OECMAKE_GENERATOR_ARGS", "-G Ninja -DCMAKE_MAKE_PROGRAM=ninja") + d.setVar("OECMAKE_GENERATOR_ARGS", args) d.setVarFlag("do_compile", "progress", r"outof:^\[(\d+)/(\d+)\]\s+") else: bb.fatal("Unknown CMake Generator %s" % generator) -- cgit v1.2.3-54-g00ecf