This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Environment variables created during pre-build do not carryover to build process

I create an environment variable during the pre-build step for use during the build process.  However, this variable do not seem to carry forward into the actual build environment.

As a simple example, if I put the following in the pre-build steps:

set FOOBAR=true

And then reference ${FOOBAR} in the Predefined symbols

BARBUZ=${FOOBAR}

BARBUZ is undefined during the compilation process.

If I set FOOBAR in the environment outside of CCS and then kick off the headless build, this works just fine (presumably because FOOBAR is still in the same environment as the build process).

I want to be able to build from the IDE and not have to close it and build from the command line.  Is there a way to keep variables created during pre-build around for the actual build?

Thanks,

Jason

  • Jason,

    I will check but I believe the pre and post build steps are created in separate environments.

    One possibility would be to modify the build command for the project to run your own script.

    In the project properties you could uncheck the box to use the default command and replace it with your own.

    That could be a batch file that sets the environment variable and then calls the build command.  

    Regards,

    John