[OE-core] [PATCH] cmake.bbclass: use `cmake --build` to build & install

Andre McCurdy armccurdy at gmail.com
Mon May 1 22:26:13 UTC 2017


On Mon, May 1, 2017 at 12:42 PM, Cody P Schafer <dev at codyps.com> wrote:
> Rather than presuming `make` is the generator, use cmake's generic
> `cmake --build` feature (which knows to call the appropriate generator).
>
> Both DESTDIR and VERBOSE still behave as intended when used as
> environment variables instead of make variable-arguments.
>
> This makes it more straight forward for others to select other cmake
> generators (many folks have been reaching for `ninja` lately).
>
> Signed-off-by: Cody P Schafer <dev at codyps.com>
> ---
>  meta/classes/cmake.bbclass | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
> index 12df617ad8..05ec50d385 100644
> --- a/meta/classes/cmake.bbclass
> +++ b/meta/classes/cmake.bbclass
> @@ -135,13 +135,11 @@ cmake_do_configure() {
>
>  do_compile[progress] = "percent"
>  cmake_do_compile()  {
> -       cd ${B}

Removing the redundant "cd ${B}" should perhaps be a separate commit?

> -       base_do_compile VERBOSE=1
> +       VERBOSE=1 cmake --build '${B}'

This looks like it will cause parallel make and EXTRA_OEMAKE options
to be ignored?

>  }
>
>  cmake_do_install() {
> -       cd ${B}
> -       oe_runmake 'DESTDIR=${D}' install
> +       DESTDIR='${D}' cmake --build '${B}' --target install
>  }
>
>  EXPORT_FUNCTIONS do_configure do_compile do_install do_generate_toolchain_file
> --
> 2.12.2
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core



More information about the Openembedded-core mailing list