All of lore.kernel.org
 help / color / mirror / Atom feed
* Problems finding python when using a cmake recipe
@ 2016-07-14 10:22 S.Jaritz
  2016-07-14 11:04 ` Burton, Ross
  0 siblings, 1 reply; 3+ messages in thread
From: S.Jaritz @ 2016-07-14 10:22 UTC (permalink / raw)
  To: yocto

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

Hej

I want to create a recipe for an application. This application is 
generated through cmake. In the cmake file "CMakeLists.txt" is the 
passage:
##############
include(FindPythonInterp)
include(FindPythonLibs)
....
add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/error.cpp" 
"${CMAKE_BINARY_DIR}/error.hpp"non_existant_file
    COMMENT "create error.cpp"
    COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_SOURCE_DIR}/mc2cpp.py" 
"${CMAKE_SOURCE_DIR}/Common/ErrorCodes/Error_Build/Errors.mc" 
"${CMAKE_BINARY_DIR}/error"
)
##############

This generates a header and a cpp file, which contains some error codes. 
When executing the cmake in my common environment it works fine. Under 
Bitbake it fails. Python is not found.

How to configure the recipe or the configuration to get it run?

Regards!

Stefan Jaritz


------------------------------------------------------------
ESA Elektroschaltanlagen Grimma GmbH
Broner Ring 30
04668 Grimma
Telefon: +49 3437 9211 176
Telefax: +49 3437 9211 26
E-Mail: s.jaritz@esa-grimma.de
Internet: www.esa-grimma.de


Geschäftsführer:
Dipl.-Ing. Jörg Gaitzsch
Jörg Reinker

Sitz der Gesellschaft: Grimma
Ust.-ID: DE 141784437
Amtsgericht: Leipzig, HRB 5159
Steuernummer: 238/108/00755


Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte 
Informationen. 
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich 
erhalten 
haben, informieren Sie bitte sofort den Absender und löschen Sie diese 
Nachricht. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser 
Mail 
ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you 
are 
not the intended recipient (or have received this e-mail in error) please 
notify the sender immediately and destroy this e-mail. Any unauthorized 
copying, disclosure or distribution of the material in this e-mail is 
strictly 
forbidden.

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

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

* Re: Problems finding python when using a cmake recipe
  2016-07-14 10:22 Problems finding python when using a cmake recipe S.Jaritz
@ 2016-07-14 11:04 ` Burton, Ross
  2016-07-14 11:23   ` S.Jaritz
  0 siblings, 1 reply; 3+ messages in thread
From: Burton, Ross @ 2016-07-14 11:04 UTC (permalink / raw)
  To: S.Jaritz; +Cc: yocto

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

On 14 July 2016 at 11:22, <S.Jaritz@esa-grimma.de> wrote:

> I want to create a recipe for an application. This application is
> generated through cmake. In the cmake file "CMakeLists.txt" is the passage:
> ##############
> include(FindPythonInterp)
> include(FindPythonLibs)
> ....
> add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/error.cpp"
> "${CMAKE_BINARY_DIR}/error.hpp"non_existant_file
>     COMMENT "create error.cpp"
>     COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_SOURCE_DIR}/mc2cpp.py"
> "${CMAKE_SOURCE_DIR}/Common/ErrorCodes/Error_Build/Errors.mc"
> "${CMAKE_BINARY_DIR}/error"
> )
> ##############
>
> This generates a header and a cpp file, which contains some error codes.
> When executing the cmake in my common environment it works fine. Under
> Bitbake it fails. Python is not found.
>

This is because the cmake class stops cmake from finding binaries on the
host.  I'm not convinced this is the right thing to do but haven't had the
time to research the problem.

Add OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH" to your recipe after
inherit cmake and it will look for and find the Python interpretter in
/usr/bin.

Ross

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

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

* Re: Problems finding python when using a cmake recipe
  2016-07-14 11:04 ` Burton, Ross
@ 2016-07-14 11:23   ` S.Jaritz
  0 siblings, 0 replies; 3+ messages in thread
From: S.Jaritz @ 2016-07-14 11:23 UTC (permalink / raw)
  To: Burton, Ross; +Cc: yocto

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

It works fine! Problem solved

Stefan Jaritz

------------------------------------------------------------
ESA Elektroschaltanlagen Grimma GmbH
Broner Ring 30
04668 Grimma
Telefon: +49 3437 9211 176
Telefax: +49 3437 9211 26
E-Mail: s.jaritz@esa-grimma.de
Internet: www.esa-grimma.de


Geschäftsführer:
Dipl.-Ing. Jörg Gaitzsch
Jörg Reinker

Sitz der Gesellschaft: Grimma
Ust.-ID: DE 141784437
Amtsgericht: Leipzig, HRB 5159
Steuernummer: 238/108/00755


Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte 
Informationen. 
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich 
erhalten 
haben, informieren Sie bitte sofort den Absender und löschen Sie diese 
Nachricht. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser 
Mail 
ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you 
are 
not the intended recipient (or have received this e-mail in error) please 
notify the sender immediately and destroy this e-mail. Any unauthorized 
copying, disclosure or distribution of the material in this e-mail is 
strictly 
forbidden.



Von:    "Burton, Ross" <ross.burton@intel.com>
An:     S.Jaritz@esa-grimma.de
Kopie:  "yocto@yoctoproject.org" <yocto@yoctoproject.org>
Datum:  14.07.2016 13:05
Betreff:        Re: [yocto] Problems finding python when using a cmake 
recipe




On 14 July 2016 at 11:22, <S.Jaritz@esa-grimma.de> wrote:
I want to create a recipe for an application. This application is 
generated through cmake. In the cmake file "CMakeLists.txt" is the 
passage: 
############## 
include(FindPythonInterp) 
include(FindPythonLibs) 
.... 
add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/error.cpp" 
"${CMAKE_BINARY_DIR}/error.hpp"non_existant_file 
    COMMENT "create error.cpp" 
    COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_SOURCE_DIR}/mc2cpp.py" 
"${CMAKE_SOURCE_DIR}/Common/ErrorCodes/Error_Build/Errors.mc" 
"${CMAKE_BINARY_DIR}/error" 
) 
############## 

This generates a header and a cpp file, which contains some error codes. 
When executing the cmake in my common environment it works fine. Under 
Bitbake it fails. Python is not found. 

This is because the cmake class stops cmake from finding binaries on the 
host.  I'm not convinced this is the right thing to do but haven't had the 
time to research the problem.

Add OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH" to your recipe after 
inherit cmake and it will look for and find the Python interpretter in 
/usr/bin.

Ross

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

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

end of thread, other threads:[~2016-07-14 11:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-14 10:22 Problems finding python when using a cmake recipe S.Jaritz
2016-07-14 11:04 ` Burton, Ross
2016-07-14 11:23   ` S.Jaritz

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.