Re: bitbake with cmake recipe


Zafrullah Syed <zafrullahmehdi@...>
 

Hi Stefan,

I updated my recipe:

DESCRIPTION = "cameracapture application" 
SECTION = "examples" 
LICENSE = "CLOSED" 
PR = "r0" 

DEPENDS = "opencv"

SRC_URI = "git://github.com/zafrullahsyed/cameracapture.git;protocol=https;tag=v0.1"

S = "${WORKDIR}/git"
inherit pkgconfig cmake

I have my source file and CMakeLists.txt as tar on github. tar is not getting downloaded.

--> If I remove tar and keep just source file and CMakeLists.txt, then also it is not getting downloaded. I am getting 

CMake Error: The source directory "/home/siguser/yocto/build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/cameracapture-0.1-r0/cameracapture-0.1" does not appear to contain CMakeLists.txt.

--> I copied my CMakeLists.txt file in ${WORKDIR}/git and tried the build, got this following error:

ERROR: Function failed: do_configure (see /home/siguser/yocto/build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/cameracapture-0.1-r0/temp/log.do_configure.10784 for further information)
ERROR: Logfile of failure stored in: /home/siguser/yocto/build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/cameracapture-0.1-r0/temp/log.do_configure.10784
Log data follows:
| DEBUG: Executing python function sysroot_cleansstate
| DEBUG: Python function sysroot_cleansstate finished
| DEBUG: SITE files ['endian-little', 'bit-32', 'arm-common', 'common-linux', 'common-glibc', 'arm-linux', 'arm-linux-gnueabi', 'common']
| DEBUG: Executing shell function autotools_preconfigure
| DEBUG: Shell function autotools_preconfigure finished
| DEBUG: Executing shell function do_configure
| CMake Error at /home/siguser/yocto/build/tmp/sysroots/x86_64-linux/usr/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:95 (MESSAGE):
|   Could not find toolchain file:
|   /home/siguser/yocto/build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/cameracapture-0.1-r0/toolchain.cmake
| Call Stack (most recent call first):
|   CMakeLists.txt:2 (project)
| CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
| Missing variable is:
| CMAKE_C_COMPILER_ENV_VAR
| CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
| Missing variable is:
| CMAKE_C_COMPILER
| CMake Error: Could not find cmake module file:/home/siguser/yocto/build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/cameracapture-0.1-r0/git/CMakeFiles/CMakeCCompiler.cmake
| CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
| Missing variable is:
| CMAKE_CXX_COMPILER_ENV_VAR
| CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
| Missing variable is:
| CMAKE_CXX_COMPILER
| CMake Error: Could not find cmake module file:/home/siguser/yocto/build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/cameracapture-0.1-r0/git/CMakeFiles/CMakeCXXCompiler.cmake
| CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
| CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
| -- Configuring incomplete, errors occurred!
| ERROR: Function failed: do_configure (see /home/siguser/yocto/build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/cameracapture-0.1-r0/temp/log.do_configure.10784 for further information)
ERROR: Task 6 (/home/siguser/yocto/poky/meta-bebot/recipes-bebot/cameracapture/cameracapture_0.1.bb, do_configure) failed with exit code '1'

Do I need to set CXX Compiler in my CMakeLists.txt? 

My CmakeLists.txt file:

cmake_minimum_required(VERSION 2.8)
project(cameracapture)
find_package( OpenCV REQUIRED )
add_executable( cameracapture cameracapture.cpp )
target_link_libraries( cameracapture ${OpenCV_LIBS} )

Can you please give me some inputs?

Thanks & Regards,

Zafrullah
Universität Paderborn.


On Fri, Aug 23, 2013 at 9:09 AM, Stefan Herbrechtsmeier <stefan@...> wrote:
Am 22.08.2013 20:13, schrieb Zafrullah Syed:
Hi all,

I am newbie and I am learning stuff.

I have a c++ code and CMakeLists.txt on Github which needs to be run with Cmake. I am trying to get that code embed into my build using my own recipe. This is my first experience with Cmake. I have no clue what should I write in my recipe.

My recipe is as follows:

DESCRIPTION = "cameracapture application" 
SECTION = "examples" 
LICENSE = "CLOSED" 
PR = "r0" 

DEPENDS += "opencv"
inherit cmake pkgconfig


do_configure() {
    ${BUILD_CXX} cameracapture.cpp -o cameracapture
    }
Why you want to compile something during configure? Remove this function.


EXTRA_OECMAKE=""
You don't need this if you don't need to pass additional definitions to cmake.



I know this recipe is wrong, I looked up many other recipes that use Cmake

each of them have their own parameters and functions.

Everytime I build my system I get this error:

ERROR: Function failed: do_configure (see /home/siguser/yocto/build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/cameracapture-0.1-r0/temp/log.do_configure.1410 for further information)
ERROR: Logfile of failure stored in: /home/siguser/yocto/build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/cameracapture-0.1-r0/temp/log.do_configure.1410
Log data follows:
| DEBUG: Executing python function sysroot_cleansstate
| DEBUG: Python function sysroot_cleansstate finished
| DEBUG: SITE files ['endian-little', 'bit-32', 'arm-common', 'common-linux', 'common-glibc', 'arm-linux', 'arm-linux-gnueabi', 'common']
| DEBUG: Executing shell function autotools_preconfigure
| DEBUG: Shell function autotools_preconfigure finished
| DEBUG: Executing shell function do_configure
| CMake Error: The source directory "/home/siguser/yocto/build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/cameracapture-0.1-r0/cameracapture-0.1" does not appear to contain CMakeLists.txt.
Are you sure this directory exists and contain the CMakeLists.txt file? Maybe you have to adjust the S variable to point to the directory of your source code.


| Specify --help for usage, or press the help button on the CMake GUI.
| ERROR: Function failed: do_configure (see /home/siguser/yocto/build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/cameracapture-0.1-r0/temp/log.do_configure.1410 for further information)
ERROR: Task 579 (/home/siguser/yocto/poky/meta-bebot/recipes-bebot/cameracapture/cameracapture_0.1.bb, do_configure) failed with exit code '1'

I have no clue what I should write in my recipe file. Yocto doesn't have any tutorial for this.

Can anyone give some hints where I am doing wrong or what should be included in my recipe?
You can take a look at one of my simple recipes:
http://opensource.cit-ec.de/projects/meta-openrobotix/repository/revisions/master/entry/recipes-connectivity/rsb/rsb_git.bb




--
Regards,
Zafrullah Syed

Join yocto@lists.yoctoproject.org to automatically receive all group messages.