Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Adding an argument to the build

Thanks everybody. The IConfigurationEnvironmentVariableSupplier does what I need it to do.

Richard


From: cdt-dev-bounces@xxxxxxxxxxx [cdt-dev-bounces@xxxxxxxxxxx] on behalf of Marc-André Laperle [marc-andre.laperle@xxxxxxxxxxxx]
Sent: Monday, May 09, 2016 9:59 AM
To: CDT General developers list.
Subject: Re: [cdt-dev] Adding an argument to the build

You should be able to set env. variables per configuration so even more specific than per project.
I have done it before in org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsEnvironmentVariableSupplier.java
but you can probably also add it directly to the configuration without using a IConfigurationEnvironmentVariableSupplier

Marc-André


From: cdt-dev-bounces@xxxxxxxxxxx [cdt-dev-bounces@xxxxxxxxxxx] on behalf of Memory, Richard [Richard_Memory@xxxxxxxxxx]
Sent: Monday, 09 May 2016 11:27 AM
To: CDT General developers list.
Subject: Re: [cdt-dev] Adding an argument to the build

Using an environment variable is a good idea. With that said, is it possible add an environment variable per project (and not globally)?

For example, if I have project1, I'd like to set myarg=foobar1, and for project2, I'd like to set myarg=foobar2. Is this possible?

Richard


From: cdt-dev-bounces@xxxxxxxxxxx [cdt-dev-bounces@xxxxxxxxxxx] on behalf of Doug Schaefer [cdtdoug@xxxxxxxxx]
Sent: Monday, May 09, 2016 8:51 AM
To: CDT General developers list.
Subject: Re: [cdt-dev] Adding an argument to the build

Yeah, I'm not even sure changing the command in the .project file would work. Env var would be the easiest to add to all configs. CDT's env var manager doesn't seem to have an API though. You'd have to look at how the preference page inserts the env vars.

On Mon, May 9, 2016 at 10:45 AM, Marc-André Laperle <marc-andre.laperle@xxxxxxxxxxxx> wrote:
Perhaps setting an environment variable achieve the same thing? That should be easier to programmatically add.

Marc-André


From: cdt-dev-bounces@xxxxxxxxxxx [cdt-dev-bounces@xxxxxxxxxxx] on behalf of Memory, Richard [Richard_Memory@xxxxxxxxxx]
Sent: Monday, 09 May 2016 10:43 AM
To: cdt-dev@xxxxxxxxxxx
Subject: [cdt-dev] Adding an argument to the build

Hi all,

I am trying to figure out to programmatically add an argument to each build (independent of the build target).

For example,

make all myarg=foobar

One possible way that comes to mind is to obtain the org.eclipse.core.resources.IProjectDescription from the IProject, create a newCommand, and modify the buidSpec. However, I am not sure this a valid or best way of doing things.

Any suggestions and/or code examples are most welcome.

Richard

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top