All of lore.kernel.org
 help / color / mirror / Atom feed
* Select make target for cmake
@ 2015-12-10 17:24 Philipp, Damian
  2015-12-10 21:56 ` Burton, Ross
  0 siblings, 1 reply; 4+ messages in thread
From: Philipp, Damian @ 2015-12-10 17:24 UTC (permalink / raw)
  To: yocto

Hello Yocto experts,

Is it possible to specify a make target (e.g., "make server" or "make client") in a recipe using cmake? I am writing a set of recipies for a software that is built from a single source tree and thus a single CMake configuration. The CMake configuration currently contains 3 targets, resulting in 3 separate binaries. We would like to control how these binaries are distributed to packages - currently we'd like to have bitbake build one package with the main application (e.g., a server application) and another package containing all other binaries (e.g., a set of client applications).

A Google search didn't turn up anything, so I looked through cmake.bbclass, autotools.bbclass and base.bbclass. The source indicated that the variable EXTRA_OEMAKE could be abused to inject a make target - however, setting EXTRA_OEMAKE = "server" in my recipe did *not* exclude the client binaries from the resulting image. In any case, I would prefer a clean solution over abusing implementation details.

Regards,
Damian



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Select make target for cmake
  2015-12-10 17:24 Select make target for cmake Philipp, Damian
@ 2015-12-10 21:56 ` Burton, Ross
  2015-12-15  7:42   ` Philipp, Damian
  0 siblings, 1 reply; 4+ messages in thread
From: Burton, Ross @ 2015-12-10 21:56 UTC (permalink / raw)
  To: Philipp, Damian; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 722 bytes --]

On 10 December 2015 at 17:24, Philipp, Damian <Damian.Philipp@vector.com>
wrote:

> A Google search didn't turn up anything, so I looked through
> cmake.bbclass, autotools.bbclass and base.bbclass. The source indicated
> that the variable EXTRA_OEMAKE could be abused to inject a make target -
> however, setting EXTRA_OEMAKE = "server" in my recipe did *not* exclude the
> client binaries from the resulting image. In any case, I would prefer a
> clean solution over abusing implementation details.


A clearer way would be to do:

do_compile() {
    oe_runmake server
}

It's possible that the compile phase is building just the server, but then
install is building and installing everything.

Ross

[-- Attachment #2: Type: text/html, Size: 1259 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Select make target for cmake
  2015-12-10 21:56 ` Burton, Ross
@ 2015-12-15  7:42   ` Philipp, Damian
  2015-12-15  8:49     ` Burton, Ross
  0 siblings, 1 reply; 4+ messages in thread
From: Philipp, Damian @ 2015-12-15  7:42 UTC (permalink / raw)
  To: yocto

Hello,

> From: Burton, Ross [mailto:ross.burton@intel.com] 
> Sent: Thursday, December 10, 2015 10:57 PM
> A clearer way would be to do:
> 
> do_compile() {
>    oe_runmake server
> }
>
> It's possible that the compile phase is building just the server, but then install is building and installing everything.

I tried your suggestion - indeed, cmake is then building the remaining binaries in the install phase. Furthermore, it appears that cmake itself is lacking support for multiple install targets.

However, I did eventually find a solution. A yocto recipe can have multiple packages as output. In fact, the default seems to be to create ${PN}, ${PN}-dev and ${PN}-dbg packages. I simply added ${PN}-client and ${PN}-client-dbg and manually sorted all the client files into those packages using the FILES_* variables. You then get a clean separation of client- and server packages and can install either or both using, e.g., INSTALL_IMAGE.

Regards
Damian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Select make target for cmake
  2015-12-15  7:42   ` Philipp, Damian
@ 2015-12-15  8:49     ` Burton, Ross
  0 siblings, 0 replies; 4+ messages in thread
From: Burton, Ross @ 2015-12-15  8:49 UTC (permalink / raw)
  To: Philipp, Damian; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 654 bytes --]

On 15 December 2015 at 07:42, Philipp, Damian <Damian.Philipp@vector.com>
wrote:

> However, I did eventually find a solution. A yocto recipe can have
> multiple packages as output. In fact, the default seems to be to create
> ${PN}, ${PN}-dev and ${PN}-dbg packages. I simply added ${PN}-client and
> ${PN}-client-dbg and manually sorted all the client files into those
> packages using the FILES_* variables. You then get a clean separation of
> client- and server packages and can install either or both using, e.g.,
> INSTALL_IMAGE.
>

Yep, that's the ideal solution: build it all and use packages to control
what is installed.

Ross

[-- Attachment #2: Type: text/html, Size: 1049 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-12-15  8:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-10 17:24 Select make target for cmake Philipp, Damian
2015-12-10 21:56 ` Burton, Ross
2015-12-15  7:42   ` Philipp, Damian
2015-12-15  8:49     ` Burton, Ross

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.