All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 03/14] pkg-cmake.mk: rework toolchainfile.cmake
Date: Thu, 24 Apr 2014 22:59:58 +0200	[thread overview]
Message-ID: <53597B4E.1030808@mind.be> (raw)
In-Reply-To: <1398293313-17580-4-git-send-email-s.martin49@gmail.com>

On 24/04/14 00:48, Samuel Martin wrote:
> Signed-off-by: Samuel Martin <s.martin49@gmail.com>
> Cc: Arnout Vandecappelle <arnout@mind.be>

 More explicit commit log:

By putting the content of toolchainfile.cmake in a separate define, we
can remove a lot of the quoting and it becomes much more similar to the
resulting file.

 Otherwise, looks good to me except for the quoting.

> 
> ---
> changes v1 -> v2:
> - new patch
> ---
>  package/pkg-cmake.mk | 30 ++++++++++++++++--------------
>  1 file changed, 16 insertions(+), 14 deletions(-)
> 
> diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
> index 963a423..af8ecf5 100644
> --- a/package/pkg-cmake.mk
> +++ b/package/pkg-cmake.mk
> @@ -158,19 +158,21 @@ host-cmake-package = $(call inner-cmake-package,host-$(pkgname),$(call UPPERCASE
>  # Generation of the CMake toolchain file
>  ################################################################################
>  
> +define TOOLCHAINFILE_CMAKE
> +set(CMAKE_SYSTEM_NAME Linux)
> +set(CMAKE_C_COMPILER $(TARGET_CC_NOCCACHE))
> +set(CMAKE_CXX_COMPILER $(TARGET_CXX_NOCCACHE))

 Amendment to the comment I made on the previous patch 2/14: the quoting
of these two should of course be consistent with the quoting of
PROGRAM_PATH and FIND_ROOT_PATH. So I would say to add quotes.



 Regards,
 Arnout

> +set(CMAKE_C_FLAGS "$${CMAKE_C_FLAGS} $(TARGET_CFLAGS)" CACHE STRING "Buildroot CFLAGS" FORCE)
> +set(CMAKE_CXX_FLAGS "$${CMAKE_CXX_FLAGS} $(TARGET_CXXFLAGS)" CACHE STRING "Buildroot CXXFLAGS" FORCE)
> +set(CMAKE_INSTALL_SO_NO_EXE 0)
> +set(CMAKE_PROGRAM_PATH $(HOST_DIR)/usr/bin)
> +set(CMAKE_FIND_ROOT_PATH $(STAGING_DIR))
> +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
> +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
> +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
> +set(ENV{PKG_CONFIG_SYSROOT_DIR} $(STAGING_DIR))
> +endef
> +
>  $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
>  	@mkdir -p $(@D)
> -	@printf "\
> -	set(CMAKE_SYSTEM_NAME Linux)\n\
> -	set(CMAKE_C_COMPILER $(TARGET_CC_NOCCACHE))\n\
> -	set(CMAKE_CXX_COMPILER $(TARGET_CXX_NOCCACHE))\n\
> -	set(CMAKE_C_FLAGS \"\$${CMAKE_C_FLAGS} $(TARGET_CFLAGS)\" CACHE STRING \"Buildroot CFLAGS\" FORCE)\n\
> -	set(CMAKE_CXX_FLAGS \"\$${CMAKE_CXX_FLAGS} $(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\
> -	set(ENV{PKG_CONFIG_SYSROOT_DIR} $(STAGING_DIR))\n\
> -	" > $@
> +	@printf '$(subst $(sep),\n,$(TOOLCHAINFILE_CMAKE))' > $@
> 


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

  reply	other threads:[~2014-04-24 20:59 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-23 22:48 [Buildroot] [PATCH 00/14] CMake infrastructure refactoring Samuel Martin
2014-04-23 22:48 ` [Buildroot] [PATCH 01/14] pkg-cmake.mk: replace "echo -en" with printf Samuel Martin
2014-04-24 20:26   ` Arnout Vandecappelle
2014-04-24 20:31     ` Peter Korsgaard
2014-04-23 22:48 ` [Buildroot] [PATCH 02/14] pkg-cmake.mk: remove unneeded quotes in the generated toolchainfile.cmake Samuel Martin
2014-04-24 20:34   ` Arnout Vandecappelle
2014-04-23 22:48 ` [Buildroot] [PATCH 03/14] pkg-cmake.mk: rework toolchainfile.cmake Samuel Martin
2014-04-24 20:59   ` Arnout Vandecappelle [this message]
2014-04-23 22:48 ` [Buildroot] [PATCH 04/14] pkg-cmake.mk: do not hardcode absolute path in toolchainfile.cmake Samuel Martin
2014-04-24 22:10   ` Arnout Vandecappelle
2014-04-23 22:48 ` [Buildroot] [PATCH 05/14] pkg-cmake.mk: enable ccache for cmake packages Samuel Martin
2014-04-24 22:39   ` Arnout Vandecappelle
2014-05-29 11:03     ` Samuel Martin
2014-04-23 22:48 ` [Buildroot] [PATCH 06/14] pkg-cmake.mk: cosmetic changes in the generated toolchainfile.cmake file Samuel Martin
2014-04-24  3:47   ` Baruch Siach
2014-05-28 19:07     ` Samuel Martin
2014-04-23 22:48 ` [Buildroot] [PATCH 07/14] pkg-cmake.mk: set additional variables in toolchainfile.cmake Samuel Martin
2014-04-24 22:41   ` Arnout Vandecappelle
2014-05-28 19:09     ` Samuel Martin
2014-04-23 22:48 ` [Buildroot] [PATCH 08/14] rpi-userland: cleanup *_CONF_OPT Samuel Martin
2014-04-23 22:48 ` [Buildroot] [PATCH 09/14] pkg-cmake.mk: globally disable BUILD_TESTING flag Samuel Martin
2014-04-24 22:45   ` Arnout Vandecappelle
2014-05-28 19:17     ` Samuel Martin
2014-04-23 22:48 ` [Buildroot] [PATCH 10/14] pkg-cmake.mk: globally drive the CMAKE_BUILD_TYPE flag using BR2_ENABLE_DEBUG Samuel Martin
2014-04-24 22:46   ` Arnout Vandecappelle
2014-05-28  8:42     ` Maxime Hadjinlian
2014-04-23 22:48 ` [Buildroot] [PATCH 11/14] openpowerlink: do not override CMAKE_BUILD_TYPE Samuel Martin
2014-04-23 22:48 ` [Buildroot] [PATCH 12/14] opencv: " Samuel Martin
2014-04-23 22:48 ` [Buildroot] [PATCH 13/14] flann: " Samuel Martin
2014-04-23 22:48 ` [Buildroot] [PATCH 14/14] qhull: " Samuel Martin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53597B4E.1030808@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.