[Buildroot] [PATCH v2 1/4] Makefile: generate CMake toolchain-file in $(O)

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Tue Jan 25 23:21:13 UTC 2011


Hello Bjorn,

On Sat, 15 Jan 2011 21:53:25 +0100
Bjørn Forsman <bjorn.forsman at gmail.com> wrote:

> +	set(CMAKE_SYSTEM_NAME Linux)\n\
> +	set(CMAKE_C_COMPILER $(CMAKE_TARGET_CC))\n\
> +	set(CMAKE_CXX_COMPILER $(CMAKE_TARGET_CXX))\n\
> +	set(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS} $(CMAKE_TARGET_CFLAGS)\" CACHE STRING \"Buildroot CFLAGS\" FORCE)\n\
> +	set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} $(CMAKE_TARGET_CXXFLAGS)\" CACHE STRING \"Buildroot CXXFLAGS\" FORCE)\n\
> +	set(CMAKE_INSTALL_SO_NO_EXE 0)\n\
> +	set(CMAKE_PROGRAM_PATH \"$(HOST_DIR)/usr/bin\")\n\
> +	set(CMAKE_FIND_ROOT_PATH \"$(STAGING_DIR)\")\n\
> +	set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)\n\
> +	set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)\n\
> +	set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)\n\
> +	" > $@

Could you also add:

+       set(ENV{PKG_CONFIG_SYSROOT_DIR} $(STAGING_DIR))\n\

This is needed to get CMake pkg-config module to work properly.

I am not entirely happy with the name/location of the CMake toolchain
file, but that's something we can sort out later.

I have tested your patchset with my qserialport library (that uses
CMake as its build system and relies on Qt) and my custom application
(that uses CMake, Qt and qserialport), and it worked fine with  the
PKG_CONFIG_SYSROOT_DIR change mentionned above.

So, once this change is done, your patch gets my:

Acked-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>

Thanks!

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com


More information about the buildroot mailing list