Hi All,

I have set up a Qt application for inclusion in a Yocto build.
I have used some environment variables for passing version information into the 
build (using the .pro file) and qmake
When I set the environment variables (GDBVERSIONMAJOR, etc.) on the host side, 
and then run Qt Creator, I get the correct compiled output.
This means (to me) that I have correctly formed the .pro file, and all the 
remaining dependencies.
When I set the environment variables before running the yocto build, I do not 
get the environment variables picked up.

I have added the variables to the bitbake whitelist so:
export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE GDBTYPE GDBRELEASE GDBVERSIONMAJOR 
GDBVERSIONMINOR GDBVERSIONBUILD"

The variables are set before the bitbake command is issued (as evidenced by 
some echo commands in the script I am running):
Listing GDBTYPE, GDBRELEASE, GDBVERSIONMAJOR, GDBVERSIONMINOR, GDBVERSIONBUILD
[branch]
[sgm.gdbMultiPacket]
[0]
[99]
[00012]

The .pro file has the following lines:
<snip>
# for version control
VERSION_MAJOR = $(GDBVERSIONMAJOR)
VERSION_MINOR = $(GDBVERSIONMINOR)
VERSION_BUILD = $(GDBVERSIONBUILD)

# for testing
#message(GDB Version values: $$(GDBVERSIONMAJOR) $$(GDBVERSIONMINOR) 
$$(GDBVERSIONBUILD))
#message(GDB Version values: $(GDBVERSIONMAJOR) $(GDBVERSIONMINOR) 
$(GDBVERSIONBUILD))
message(GDB Version values (internal): $${VERSION_MAJOR} $${VERSION_MINOR} 
$${VERSION_BUILD})
#message(Current directory: $(PWD))
#message(Current directory: $$(PWD))


# This section takes the release Major, Minor, and Build numbers and adds them 
to command line Defines for the version.h file to use
GDB_VERSION = -DGDB_VERSION_MAJOR=$${VERSION_MAJOR} 
-DGDB_VERSION_MINOR=$${VERSION_MINOR} -DGDB_VERSION_BUILD=$${VERSION_BUILD} 
-DCURR_DIR=$$(PWD)
QMAKE_CFLAGS+=$${GDB_VERSION}
QMAKE_CFLAGS_DEBUG+=$${GDB_VERSION}
QMAKE_CXXFLAGS+=$${GDB_VERSION}
</snip>

When I run the bitbake, the command lines used to do the compiles have the 
following piece:
-DGDB_VERSION_MAJOR= -DGDB_VERSION_MINOR= -DGDB_VERSION_BUILD= 
-DCURR_DIR=/home/user/<full current working dir>.

I also get the following line in the logs:
Project MESSAGE: GDB Version values (internal):   
(this was generated by the message line in the .pro file)

It appears that the PWD environment variable is being picked up and used, but 
for some strange reason, the GDBVERSIONxxx variables are either not being 
picked up, or are missing in the make phase of the processing.
Trying with $$(GDBVERSIONxxx) - picking up the variables in the qmake phase - 
gives the same results

Does anybody have any clues on what might be happening here?

Why are the environment variables not being used?

-- 
Stephen Munnings 
Sr. Design Engineer | 519.594.0976 
www.nuvation.com
-- 
_______________________________________________
meta-freescale mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-freescale

Reply via email to