[Buildroot] Environment Variables and CMAKE

Samuel Martin s.martin49 at gmail.com
Sun May 26 12:16:24 UTC 2013


Hi John,

2013/5/22 john <john.osullivan at cloudiumsystems.com>:
> Hi,
>
> I have a cmake based project which I am trying to incorporate into
> buildroot-2012.05
>
> As part of the configuration of the code I need to pass it an
> environment variable $(CLIENT_VER) which I generate at the time of
> building in the source directory (which I check out of SVN).
> I have tried various approaches without success.
>
> This is my mk file
> #I first tried this approach by generating the cmake configuration
> #command with a script and then executing that script
> #but the problem here was I would need to know the location of the
> #buildroot generated version of cmake and the toolchain file
> #I could figure these out in the script but I felt there must be a
> #simpler approach
> #define CLIENT_BARROW_CONFIGURE_CMDS
> #       (cd $(CLIENT_BARROW_SRCDIR) && source set_environment.sh \
> #       && ./cmake_run \
> #       )
> #endef

Does the set_environment.sh script do anything else than setting the
CLIENT_VER env. var.?
If this version number is stored in its own file, then another way is:
CLIENT_BARROW_CONF_OPT += -DCLIENT_VER_STR="$(shell cat
version_file.txt 2>/dev/null)"

Regards,

-- 
Samuel


More information about the buildroot mailing list