Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] C/C++ Build>Build Variables and Environment

Hi,

as an ISV I need to add a new feature to CDT that lets my user amend the environment used for doing builds, on a per configuration basis, by specifying a script that for example defines a number of environment variables; eg for windows host they will have an setenv.bat file and linux an setenv.sh. My intention is to graft a file location and browse button onto a suitable dialog inside the project C/C++ Build properties. I am trying to decide whether to add this to the Build Variables page or the Environment page, but am slightly confused as to what the exact intention of these two dialogs is as logically they seem to overlap in what they are trying to achieve.

Reading the help helps me understand even less:

Build Variables
Shows the current list of environment variables and their corresponding value. These are the environment variable values used when running an application.

Environment
Shows the current list of environment variables and their corresponding value. These are the environment variable values used when building.

I constructed an example Makefile project to test a few things. In the makefile I added $(ENVVAR_INSbl30186) to my compile line and in my c application I use some conditional compilation to test MACRO_INSbl30186. I found that defining the environment var in the Environment page worked; doing it in the Build Variables meant I had build errors.

So to test the claim that the Build Variables page is used when "running an application." I defined another env var, MY_PROG_ARGS, and then in a "run" configuration made reference to that env var in the Argument>Program Arguments list, using ${env_var:MY_PROG_ARGS} syntax. Then I ran my application which prints the program arguments. However no arguments appear to be passed.

So I am stumped as to the purpose of the Build Variables view. Any enlightenment gratefully received.

cheers john

C/C++ Project Properties, Build Variables
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclipse.cdt.doc.user/reference/cdt_u_prop_build_variables.htm




C/C++ Project Properties, Environment
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclipse.cdt.doc.user/reference/cdt_u_prop_build_variables.htm



-- 
      john moule
      software engineer
      stmicroelectronics ltd
      1000 aztec west
      bristol bs32 4sq
      uk
   t  +44 (0)1454 462481
TINA  065 2481

Back to the top