Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6939287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:36:12+00:00 2026-05-27T12:36:12+00:00

I have the following sample code: program boohoo; {$APPTYPE CONSOLE} {$IFDEF boo} {$MESSAGE warn

  • 0

I have the following sample code:

program boohoo;

{$APPTYPE CONSOLE}

{$IFDEF boo}
{$MESSAGE warn 'boo'}
{$ENDIF}

{$IFDEF hoo}
{$MESSAGE warn 'hoo'}
{$ENDIF}

begin
end.

In the project options the conditional boo is defined. I would like to be able to add the conditional hoo as part of my msbuild command line.

I have tried it like this:

msbuild boohoo.dproj /p:Config=Release;DCC_Define="$(DCC_Define);hoo"

The output shows hoo but not boo. When I use verbose output to see the dcc32 command I see

-D$;hoo

Clearly I can do it like this:

msbuild boohoo.dproj /p:Config=Release;DCC_Define="boo;hoo"

but naturally I want to use whatever conditionals are declared in the project options plus what I specify on the command line.

Is there any way for me to specify this property with reference to the value from the underlying configuration?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:36:13+00:00Added an answer on May 27, 2026 at 12:36 pm

    Disclaimer: don’t use MsBuild myself yet, all taken from the docs and some IDE experimentation

    According to MsBuild command line reference ( http://msdn.microsoft.com/en-us/library/ms164311.aspx ):

    /property:name=value

    Sets or overrides these project-level properties, where name is the
    property name and value is the property value. Use a semicolon or a
    comma to separate multiple properties, or specify each property
    separately. /p is also acceptable. For example:
    /property:WarningLevel=2;OutputDir=bin\Debug

    setting or overriding is all you can do for a property value. Adding to a property value from the project file is either not possible or a case of a hidden feature.

    But I guess what you could do is define a custom property in your dproj file with an ” ” as its default value:

    <PropertyGroup>
      <ExtraDefines> </ExtraDefines>
    </PropertyGroup>
    

    reference that in your defines statement

    <DCC_Define>DUNIT;$(ExtraDefines);$(DCC_Define)</DCC_Define>
    

    which in the IDE should be DUNIT;$(ExtraDefines)

    and then specify it on the command line:

    msbuild boohoo.dproj /p:Config=Release;ExtraDefines="hoo"
    

    I did test adding the $(ExtraDefines) to the Include options for the project using the IDE. And at least that didn’t barf at me, even without having the option defined in the dproj. The commandline the IDE produced from this was:

    ...rad studio\7.0\bin\dcc32.exe --no-config -B -Q -DDEBUG;DUNIT; -E....
    

    Which seems to indicate that the $(ExtraDefines) got eliminated as it had no value. And that it should be picked up using MSBuild and specififying a value on the command line.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following sample code in a VB.NET console application. It compiles and
I have the following sample code which doesn't seem to want to run. import
I have the following code sample that im trying to wrap my head around
I have a Dictionary bound to DataGridView by using following sample code. DataGridView bound
I have downloaded sample code from Apple Center.I also have gone through following question:
I am new to Emacs, and I have the following code as a sample.
Hi following code sample seems to have some problem or either it has to
I have a question on boolean return types. Check the following code: Code Sample
i have the following simple code, but it doesn,t work <ul> <li id=one onmouseover=this.style.background-color='white';>
I have the following simple Java code: package testj; import java.util.*; public class Query<T>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.