[Buildroot] [PATCH] pkg-cmaketargets.mk: do not hardcode absolute path in toolchainfile.cmake

Samuel Martin s.martin49 at gmail.com
Tue Apr 22 23:35:52 UTC 2014


Hi Arnout, all,

On Tue, Apr 22, 2014 at 6:55 PM, Arnout Vandecappelle <arnout at mind.be> wrote:
[...]
>  Right, I forgot that the backslash is still passed. This would work, but
> is not much better:
>
> @printf \
> 'get_filename_component(_HOST_DIR $${CMAKE_CURRENT_LIST_FILE} PATH)\n'\
> '...'\
>
>
>  Or this works as well:
>
>  @printf '$(subst $(sep),\n,$(TOOLCHAINFILE_CMAKE))' > $@
>
>
> define TOOLCHAINFILE_CMAKE
>   get_filename_component(_HOST_DIR $${CMAKE_CURRENT_LIST_FILE} PATH)
>   ...
> endef
>
>  But I'm not 100% convinced that that is better either.
>

Thanks a lot for the tips.

I think I'll go for the 2nd solution, with the least quotes and the
content of "define ... endef" the closest to the one of the
toolchainfile.cmake file (only $ needs to be escaped).

However I have no strong opinion about this, so if someone thinks to a
better solution, please speak up.

Regards,

-- 
Samuel



More information about the buildroot mailing list