[yocto] CMake project not building; building from local git repo possible

Jakob Hasse jakob.hasse at smart-home-technology.ch
Mon May 29 09:29:46 PDT 2017


Hello,

I have two issues:

1.
I innocently tried to include an open source version of the ST Link 
tools (https://github.com/texane/stlink) into my yocto image.
I created a recipe fetching from git and got the error:

| CMake Error at CMakeLists.txt:105 (install):
|   install TARGETS given unknown argument "/lib".
|
|
| CMake Error at CMakeLists.txt:135 (install):
|   install TARGETS given unknown argument "/lib".
|
|
| CMake Error at usr/lib/pkgconfig/CMakeLists.txt:12 (install):
|   install FILES given unknown argument "/lib/pkgconfig/".
|
|
| CMake Error at include/CMakeLists.txt:9 (install):
|   install FILES given unknown argument "/lib".
|
|
| CMake Error at include/CMakeLists.txt:12 (install):
|   install FILES given unknown argument "/lib/stlink".

I'm not sure whether it's a CMake problem since the project compiles 
absolutely fine on my host machine with native target (the binary also 
works fine in my case).
Also, the CMake error log shows me errors about unrecognized CFlags 
(-Wmissing-variable-declarations, -Wshorten-64-to-32) which confuse me 
somewhat given the errors above.
Then I checked out the source and changed the CMake file to exclude 
corresponding flags - with no difference, errors still remain.
My recipe now looks like this:

# comment
SUMMARY = "ST-Link firmware flasher"
DESCRIPTION = ""
SECTION = "examples"
LICENSE = "MIT"
LIC_FILES_CHKSUM = 
"file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

DEPENDS = "libusb pkgconfig"

SRC_URI = "file://stlink.tar.gz"

FILES_${PN} += "${bindir}/st-flash"

S = "${WORKDIR}/git"

inherit cmake

2.
For the last step I had to repack a tar.gz out of the checked out source 
folder, otherwise bitbake complained.
Is it possible to base a yocto package on a local source folder using 
autotools or cmake class?. All the examples I found either use remote 
git repos + autotools/cmake or a local source folder without 
autotools/cmake.

Cheers and many thanks in advance,
Jakob

-- 
Jakob Hasse
Software Developement

E: jakob.hasse at smart-home-technology.ch
T: +41 44 552 02 66

Smart Home Technology GmbH
www.smart-home-technology.ch




More information about the yocto mailing list