Author Topic: Environment variable doesn't work with Scons  (Read 3914 times)

Offline a71128

  • Single posting newcomer
  • *
  • Posts: 4
Environment variable doesn't work with Scons
« on: July 31, 2017, 05:41:00 pm »
Hey guys,
I am trying to import my scons project into CB. However, I can't seem to set environment variables correctly because my scons script always shows variables missing.
Does anyone have experience with this? I would appreciate any input.
Thanks!

Best,
a71128
« Last Edit: July 31, 2017, 05:43:00 pm by a71128 »


Offline a71128

  • Single posting newcomer
  • *
  • Posts: 4
Re: Environment variable doesn't work with Scons
« Reply #2 on: July 31, 2017, 07:12:53 pm »
I am running Code::Blocks version 16.01 on Ubuntu 14.04.
The compiler I use is GNU GCC version 4.8.4.

When I try to build my code with custom scons setup.
It shows
Code
Error : environment variable DIR/CONFIG_DIR is not defined
        Please thoroughly read the file: README
        found at the root level of the Ottomatika directory and follow
        all of the instructions listed there.
        The short fix is to add to your .bashrc file the line:
          export DIR=YOURPATH/ottomatika/codebase
          export CONFIG_DIR=$OTTO_DIR/config
       
from the SConscript.

I have already tried exporting the variable in the pre-build steps, defining custom variables, and setting global variable but none of them work.

Thanks!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Environment variable doesn't work with Scons
« Reply #3 on: July 31, 2017, 08:23:48 pm »
What are you really trying to do?
Create a custom makefile project that executes scons for building?
Have you tried the env var plugin (http://wiki.codeblocks.org/index.php/Environment_Variables_plugin)?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline a71128

  • Single posting newcomer
  • *
  • Posts: 4
Re: Environment variable doesn't work with Scons
« Reply #4 on: July 31, 2017, 08:48:05 pm »
What are you really trying to do?
Create a custom makefile project that executes scons for building?
Have you tried the env var plugin (http://wiki.codeblocks.org/index.php/Environment_Variables_plugin)?
Yes, that is exactly what I would like to achieve.
I wanted to try the env var plugin. However, I  couldn't find the link to the install file.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Environment variable doesn't work with Scons
« Reply #5 on: July 31, 2017, 09:22:50 pm »
What are you really trying to do?
Create a custom makefile project that executes scons for building?
Have you tried the env var plugin (http://wiki.codeblocks.org/index.php/Environment_Variables_plugin)?
Yes, that is exactly what I would like to achieve.
I wanted to try the env var plugin. However, I  couldn't find the link to the install file.

Make sure you have the codeblocks contrib package installed via the normal Linux package installer method.

Then, in Code::Blocks look under "Plugins" -> "Manage Plugins..." to verify the Env Vars plugin is listed and enabled.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Environment variable doesn't work with Scons
« Reply #6 on: July 31, 2017, 09:59:25 pm »
And then you can enable the environment variables via
Project->Properties->EnVars option

and set the environment variables via:
Settings->Environment->Environment variables

You can use variable expansion to define environment variables: http://wiki.codeblocks.org/index.php/Variable_expansion

Offline a71128

  • Single posting newcomer
  • *
  • Posts: 4
Re: Environment variable doesn't work with Scons
« Reply #7 on: August 01, 2017, 10:57:40 pm »
Thanks, guys. I got it to work!