[OE-core] [PATCH v2] cmake.bbclass: allow searching host paths for non-target builds

Stefan Herbrechtsmeier stefan at herbrechtsmeier.net
Wed Jul 17 07:46:07 UTC 2013


Am 17.07.2013 08:26, schrieb Jonathan Liu:
> This allows /usr/bin/{ld,ar,objcopy,objdump,ranlib,strip} to be found
> and the CMAKE_{LINKER,AR,OBJCOPY,OBJDUMP,RANLIB,STRIP} cmake variables
> to be properly set for native cmake recipes.
>
> Signed-off-by: Jonathan Liu <net147 at gmail.com>
> ---
>   meta/classes/cmake.bbclass | 15 ++++++++++-----
>   1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
> index 310242e..2040147 100644
> --- a/meta/classes/cmake.bbclass
> +++ b/meta/classes/cmake.bbclass
> @@ -46,12 +46,7 @@ set( CMAKE_CXX_FLAGS_RELEASE "${OECMAKE_CXX_FLAGS_RELEASE}" CACHE STRING "CXXFLA
>   set( CMAKE_C_LINK_FLAGS "${OECMAKE_C_LINK_FLAGS}" CACHE STRING "LDFLAGS" )
>   set( CMAKE_CXX_LINK_FLAGS "${OECMAKE_CXX_LINK_FLAGS}" CACHE STRING "LDFLAGS" )
>   
> -# only search in the paths provided so cmake doesnt pick
> -# up libraries and tools from the native build machine
>   set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN})
> -set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )
> -set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
> -set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
This changes the whole find behaviour and allows cmake to find *all* 
software from the native build machine.  You should add 
NO_CMAKE_FIND_ROOT_PATH to the find_xxx calls or you could manual set 
the variables and bypass the find calls.




More information about the Openembedded-core mailing list