Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Environment Variables and CMAKE
@ 2013-05-22 16:21 john
  2013-05-24 16:51 ` Arnout Vandecappelle
  2013-05-26 12:16 ` Samuel Martin
  0 siblings, 2 replies; 4+ messages in thread
From: john @ 2013-05-22 16:21 UTC (permalink / raw)
  To: buildroot

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


#then I tried this
define CLIENT_BARROW_SET_ENVIRONMENT
	(source $(CLIENT_BARROW_SRCDIR)set_environment.sh  \
	&& echo "Running Pre Configure Hook "  \
	)
endef
CLIENT_BARROW_PRE_CONFIGURE_HOOKS = CLIENT_BARROW_SET_ENVIRONMENT

CLIENT_BARROW_VERSION = HEAD
CLIENT_BARROW_SITE = svn://cloudiumserver3/topaz/trunk/client_barrow
CLIENT_BARROW_INSTALL_STAGING = YES
CLIENT_BARROW_CONF_OPT = -DWITH_XV=OFF -DCLIENT_VER_STR=$(CLIENT_VER) 
$(eval $(call CMAKETARGETS))


My basic question is this:
Is there someway to pickup an environment variable in the process that
processes the .mk file?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] Environment Variables and CMAKE
  2013-05-22 16:21 [Buildroot] Environment Variables and CMAKE john
@ 2013-05-24 16:51 ` Arnout Vandecappelle
  2013-05-26 12:16 ` Samuel Martin
  1 sibling, 0 replies; 4+ messages in thread
From: Arnout Vandecappelle @ 2013-05-24 16:51 UTC (permalink / raw)
  To: buildroot

On 22/05/13 18:21, john wrote:
> 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.
[snip]
> My basic question is this:
> Is there someway to pickup an environment variable in the process that
> processes the .mk file?


  Isn't this what you're looking for?

CLIENT_BARROW_CONF_ENV = `$(CLIENT_BARROW_SRCDIR)set_environment.sh`

(and modify the script to echo the assignments rather than setting them).

  Regards,
  Arnout


-- 
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] Environment Variables and CMAKE
  2013-05-22 16:21 [Buildroot] Environment Variables and CMAKE john
  2013-05-24 16:51 ` Arnout Vandecappelle
@ 2013-05-26 12:16 ` Samuel Martin
  2013-05-27  9:49   ` john
  1 sibling, 1 reply; 4+ messages in thread
From: Samuel Martin @ 2013-05-26 12:16 UTC (permalink / raw)
  To: buildroot

Hi John,

2013/5/22 john <john.osullivan@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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] Environment Variables and CMAKE
  2013-05-26 12:16 ` Samuel Martin
@ 2013-05-27  9:49   ` john
  0 siblings, 0 replies; 4+ messages in thread
From: john @ 2013-05-27  9:49 UTC (permalink / raw)
  To: buildroot

Thanks Samuel and Arnout, I have gotten something working now using your
suggestions
On Sun, 2013-05-26 at 14:16 +0200, Samuel Martin wrote:
> Hi John,
> 
> 2013/5/22 john <john.osullivan@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,
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-05-27  9:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-22 16:21 [Buildroot] Environment Variables and CMAKE john
2013-05-24 16:51 ` Arnout Vandecappelle
2013-05-26 12:16 ` Samuel Martin
2013-05-27  9:49   ` john

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox