All of lore.kernel.org
 help / color / mirror / Atom feed
* shared cmake modules
@ 2019-04-03 10:07 Gabriele Zampieri
  2019-04-08 13:26 ` Gabriele Zampieri
  2019-04-08 17:05 ` Henrik Lindblom
  0 siblings, 2 replies; 5+ messages in thread
From: Gabriele Zampieri @ 2019-04-03 10:07 UTC (permalink / raw)
  To: yocto

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

Hi all,

I'm setting up a layer that will compile our applications and libraries.
All the applications are based on cmake and they share modules. Before
using yocto I kept the modules in <workspace>/cmake (under version control)
alongside applications and libraries. With yocto I wrote a recipe that
checkout the module repo and install them in
"${STAGING_DATADIR}/cmake/Modules/". I took this path from
"meta/classes/cmake.bbclass". If i build the module target, I get the files
installed in the target recipe datadir. If I want to build a library (that
depends also on my modules recipe) the task do_configure fails because
cmake cannot find none of my include. Digging around I found that the
toolchain.cmake file points to a module location that doesn't exist in the
library workdir, but in module recipe (${STAGING_DATADIR}/cmake/Modules/).

The module recipe looks like as follow:

MODULES_DEST_PATH = "${STAGING_DATADIR}/cmake/Modules"
FILES_${PN}-dev = "${MODULES_DEST_PATH}/*"

do_install() {
    DEST_DIR=${MODULES_DEST_PATH}

    # Create the destination folder
    install -d $DEST_DIR
    install -m 0444 ${S}/my/module.cmake $DEST_DIR
    ......
}

So my question is: where should I install the shared modules
(MODULE_DEST_PATH int the above snippet)? and how to update the
CMAKE_MODULE_PATH properly to append that location?

Thanks,
Gabriele

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

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

* Re: shared cmake modules
  2019-04-03 10:07 shared cmake modules Gabriele Zampieri
@ 2019-04-08 13:26 ` Gabriele Zampieri
  2019-04-08 17:05 ` Henrik Lindblom
  1 sibling, 0 replies; 5+ messages in thread
From: Gabriele Zampieri @ 2019-04-08 13:26 UTC (permalink / raw)
  To: yocto

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

bump

Il giorno mer 3 apr 2019 alle ore 12:07 Gabriele Zampieri <
gabbla.malist@gmail.com> ha scritto:

> Hi all,
>
> I'm setting up a layer that will compile our applications and libraries.
> All the applications are based on cmake and they share modules. Before
> using yocto I kept the modules in <workspace>/cmake (under version control)
> alongside applications and libraries. With yocto I wrote a recipe that
> checkout the module repo and install them in
> "${STAGING_DATADIR}/cmake/Modules/". I took this path from
> "meta/classes/cmake.bbclass". If i build the module target, I get the files
> installed in the target recipe datadir. If I want to build a library (that
> depends also on my modules recipe) the task do_configure fails because
> cmake cannot find none of my include. Digging around I found that the
> toolchain.cmake file points to a module location that doesn't exist in the
> library workdir, but in module recipe (${STAGING_DATADIR}/cmake/Modules/).
>
> The module recipe looks like as follow:
>
> MODULES_DEST_PATH = "${STAGING_DATADIR}/cmake/Modules"
> FILES_${PN}-dev = "${MODULES_DEST_PATH}/*"
>
> do_install() {
>     DEST_DIR=${MODULES_DEST_PATH}
>
>     # Create the destination folder
>     install -d $DEST_DIR
>     install -m 0444 ${S}/my/module.cmake $DEST_DIR
>     ......
> }
>
> So my question is: where should I install the shared modules
> (MODULE_DEST_PATH int the above snippet)? and how to update the
> CMAKE_MODULE_PATH properly to append that location?
>
> Thanks,
> Gabriele
>

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

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

* Re: shared cmake modules
  2019-04-03 10:07 shared cmake modules Gabriele Zampieri
  2019-04-08 13:26 ` Gabriele Zampieri
@ 2019-04-08 17:05 ` Henrik Lindblom
  2019-04-09 14:38   ` Gabriele Zampieri
  1 sibling, 1 reply; 5+ messages in thread
From: Henrik Lindblom @ 2019-04-08 17:05 UTC (permalink / raw)
  To: Gabriele Zampieri; +Cc: Yocto discussion list

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

>
> FILES_${PN}-dev = "${MODULES_DEST_PATH}/*"
>

Does your library recipe explicitly depend on <cmake_module>-dev? Can you
share the failing recipe?

Cheers,
Henrik

On Wed, Apr 3, 2019 at 1:18 PM Gabriele Zampieri <gabbla.malist@gmail.com>
wrote:

> Hi all,
>
> I'm setting up a layer that will compile our applications and libraries.
> All the applications are based on cmake and they share modules. Before
> using yocto I kept the modules in <workspace>/cmake (under version control)
> alongside applications and libraries. With yocto I wrote a recipe that
> checkout the module repo and install them in
> "${STAGING_DATADIR}/cmake/Modules/". I took this path from
> "meta/classes/cmake.bbclass". If i build the module target, I get the files
> installed in the target recipe datadir. If I want to build a library (that
> depends also on my modules recipe) the task do_configure fails because
> cmake cannot find none of my include. Digging around I found that the
> toolchain.cmake file points to a module location that doesn't exist in the
> library workdir, but in module recipe (${STAGING_DATADIR}/cmake/Modules/).
>
> The module recipe looks like as follow:
>
> MODULES_DEST_PATH = "${STAGING_DATADIR}/cmake/Modules"
> FILES_${PN}-dev = "${MODULES_DEST_PATH}/*"
>
> do_install() {
>     DEST_DIR=${MODULES_DEST_PATH}
>
>     # Create the destination folder
>     install -d $DEST_DIR
>     install -m 0444 ${S}/my/module.cmake $DEST_DIR
>     ......
> }
>
> So my question is: where should I install the shared modules
> (MODULE_DEST_PATH int the above snippet)? and how to update the
> CMAKE_MODULE_PATH properly to append that location?
>
> Thanks,
> Gabriele
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>

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

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

* Re: shared cmake modules
  2019-04-08 17:05 ` Henrik Lindblom
@ 2019-04-09 14:38   ` Gabriele Zampieri
  2019-04-09 16:27     ` Henrik Lindblom
  0 siblings, 1 reply; 5+ messages in thread
From: Gabriele Zampieri @ 2019-04-09 14:38 UTC (permalink / raw)
  To: Henrik Lindblom; +Cc: Yocto discussion list

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

Hi,

yes, following:

- cmake-modules.bb https://pastebin.com/5VqN9msS
- xxx-log.bb : https://pastebin.com/LYcPW3hc

The first one install the modules, thus is a dependency of many libraries,
the second one is a simple logger library that uses first's module

Thanks for your help,
Gabriele





Il giorno lun 8 apr 2019 alle ore 19:05 Henrik Lindblom <
henriklindblomster@gmail.com> ha scritto:

> FILES_${PN}-dev = "${MODULES_DEST_PATH}/*"
>>
>
> Does your library recipe explicitly depend on <cmake_module>-dev? Can you
> share the failing recipe?
>
> Cheers,
> Henrik
>
> On Wed, Apr 3, 2019 at 1:18 PM Gabriele Zampieri <gabbla.malist@gmail.com>
> wrote:
>
>> Hi all,
>>
>> I'm setting up a layer that will compile our applications and libraries.
>> All the applications are based on cmake and they share modules. Before
>> using yocto I kept the modules in <workspace>/cmake (under version control)
>> alongside applications and libraries. With yocto I wrote a recipe that
>> checkout the module repo and install them in
>> "${STAGING_DATADIR}/cmake/Modules/". I took this path from
>> "meta/classes/cmake.bbclass". If i build the module target, I get the files
>> installed in the target recipe datadir. If I want to build a library (that
>> depends also on my modules recipe) the task do_configure fails because
>> cmake cannot find none of my include. Digging around I found that the
>> toolchain.cmake file points to a module location that doesn't exist in the
>> library workdir, but in module recipe (${STAGING_DATADIR}/cmake/Modules/).
>>
>> The module recipe looks like as follow:
>>
>> MODULES_DEST_PATH = "${STAGING_DATADIR}/cmake/Modules"
>> FILES_${PN}-dev = "${MODULES_DEST_PATH}/*"
>>
>> do_install() {
>>     DEST_DIR=${MODULES_DEST_PATH}
>>
>>     # Create the destination folder
>>     install -d $DEST_DIR
>>     install -m 0444 ${S}/my/module.cmake $DEST_DIR
>>     ......
>> }
>>
>> So my question is: where should I install the shared modules
>> (MODULE_DEST_PATH int the above snippet)? and how to update the
>> CMAKE_MODULE_PATH properly to append that location?
>>
>> Thanks,
>> Gabriele
>> --
>> _______________________________________________
>> yocto mailing list
>> yocto@yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/yocto
>>
>

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

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

* Re: shared cmake modules
  2019-04-09 14:38   ` Gabriele Zampieri
@ 2019-04-09 16:27     ` Henrik Lindblom
  0 siblings, 0 replies; 5+ messages in thread
From: Henrik Lindblom @ 2019-04-09 16:27 UTC (permalink / raw)
  To: Gabriele Zampieri; +Cc: Yocto discussion list

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

Your recipes seem a bit off. Doesn't bitbake complain about them at all?

In your logger library you declare a dependency to
"texa-cmake-modules", not "cmake-modules". Also, assuming the naming
conflict is only present in pastebin versions of your recipes, in
cmake-modules.bb you add all files under ${MODULES_DEST_PATH} to both
FILES_${PN}-dev and FILES_${PN}. These variables are used to populate
packages ${PN}-dev and ${PN} respectively. The order in which they
"grab" the files depends on PACKAGES, which has a default value of
"${PN}-dbg ${PN}-staticdev ${PN}-dev ${PN}-doc ${PN}-locale
${PACKAGE_BEFORE_PN} ${PN}". Since ${PN}-dev appears before ${PN} in
this list, your cmake-modules package is most likely empty (I think
this should even yield a QA warning). Furthermore, your
MODULE_DEST_PATH incorrectly points to a path under ${STAGING_DATADIR}
which is also
where you install all your files in do_install(). Correct path for
installation is

${D}${datadir}/cmake/Modules

and for FILES

${datadir}/cmake/Modules/*

Depending on how you fix cmake-modules you likely need to change

DEPENDS = "cmake-modules boost"

to

DEPENDS = "cmake-modules-dev boost"

in your library recipe, adjusting for the actual name of your cmake
module.

See:
https://www.yoctoproject.org/docs/1.8/ref-manual/ref-manual.html#var-D
https://www.yoctoproject.org/docs/1.8/ref-manual/ref-manual.html#var-PACKAGES
https://www.yoctoproject.org/docs/1.8/ref-manual/ref-manual.html#var-FILES

Cheers,
Henrik

On Tue, Apr 9, 2019 at 5:39 PM Gabriele Zampieri <gabbla.malist@gmail.com>
wrote:

> Hi,
>
> yes, following:
>
> - cmake-modules.bb https://pastebin.com/5VqN9msS
> - xxx-log.bb : https://pastebin.com/LYcPW3hc
>
> The first one install the modules, thus is a dependency of many libraries,
> the second one is a simple logger library that uses first's module
>
> Thanks for your help,
> Gabriele
>
>
>
>
>
> Il giorno lun 8 apr 2019 alle ore 19:05 Henrik Lindblom <
> henriklindblomster@gmail.com> ha scritto:
>
>> FILES_${PN}-dev = "${MODULES_DEST_PATH}/*"
>>>
>>
>> Does your library recipe explicitly depend on <cmake_module>-dev? Can you
>> share the failing recipe?
>>
>> Cheers,
>> Henrik
>>
>> On Wed, Apr 3, 2019 at 1:18 PM Gabriele Zampieri <gabbla.malist@gmail.com>
>> wrote:
>>
>>> Hi all,
>>>
>>> I'm setting up a layer that will compile our applications and libraries.
>>> All the applications are based on cmake and they share modules. Before
>>> using yocto I kept the modules in <workspace>/cmake (under version control)
>>> alongside applications and libraries. With yocto I wrote a recipe that
>>> checkout the module repo and install them in
>>> "${STAGING_DATADIR}/cmake/Modules/". I took this path from
>>> "meta/classes/cmake.bbclass". If i build the module target, I get the files
>>> installed in the target recipe datadir. If I want to build a library (that
>>> depends also on my modules recipe) the task do_configure fails because
>>> cmake cannot find none of my include. Digging around I found that the
>>> toolchain.cmake file points to a module location that doesn't exist in the
>>> library workdir, but in module recipe (${STAGING_DATADIR}/cmake/Modules/).
>>>
>>> The module recipe looks like as follow:
>>>
>>> MODULES_DEST_PATH = "${STAGING_DATADIR}/cmake/Modules"
>>> FILES_${PN}-dev = "${MODULES_DEST_PATH}/*"
>>>
>>> do_install() {
>>>     DEST_DIR=${MODULES_DEST_PATH}
>>>
>>>     # Create the destination folder
>>>     install -d $DEST_DIR
>>>     install -m 0444 ${S}/my/module.cmake $DEST_DIR
>>>     ......
>>> }
>>>
>>> So my question is: where should I install the shared modules
>>> (MODULE_DEST_PATH int the above snippet)? and how to update the
>>> CMAKE_MODULE_PATH properly to append that location?
>>>
>>> Thanks,
>>> Gabriele
>>> --
>>> _______________________________________________
>>> yocto mailing list
>>> yocto@yoctoproject.org
>>> https://lists.yoctoproject.org/listinfo/yocto
>>>
>>

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

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

end of thread, other threads:[~2019-04-09 16:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-03 10:07 shared cmake modules Gabriele Zampieri
2019-04-08 13:26 ` Gabriele Zampieri
2019-04-08 17:05 ` Henrik Lindblom
2019-04-09 14:38   ` Gabriele Zampieri
2019-04-09 16:27     ` Henrik Lindblom

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.