I created a new layer over an existing Yocto git for my company project.
In this layer I added a few external autotools
based libraries.
A few applications need to link against this libraries and the application projects are all cmake
based.
Taking one of this libraries (e.g. libcoap) I could easily find some FindCoAP.cmake
to add to my library recipe.
Now if I was running on PC, it would simply be a matter of placing this FindCoAP.cmake
file in cmake
's ${CMAKE_ROOT}/Modules
dir, but how should I, from inside a bitbake
recipe (do_install hook), proceed to make my Find*.cmake
modules available to anyone's dependent projects?
Should I try to get Yocto
's cmake
CMAKE_ROOT
variable from system-information like this or is it a safer and more reliable way?
do_install_append() {
cmake --system-information | grep CMAKE_ROOT | cut -d \" -f2
install -d ${D}/$CMAKE_ROOT}/Modules
install ${S}/FindCoAP.cmake ${D}/$CMAKE_ROOT}/Modules
}
Thanks in advance.