Search code examples
visual-studiovisual-studio-2010post-build-eventpost-build

"If" syntax for post-build macros in VS 2010


I'm trying to to add a post-build macro that would conditionally copy some files after the build if the configuration is not "Debug". I'm trying the following:

if ('$(ConfigurationName)' <> 'Debug')
    copy /y $(ProjectDir)memcached.$(ConfigurationName).config   
            $(ProjectDir)memcached.config 

And I get error 255. What should be the right syntax for the 'if' statement?


Solution

  • Just figured out:

    if not $(ConfigurationName) == Debug  
       copy /y $(ProjectDir)memcached.$(ConfigurationName).config 
               $(ProjectDir)memcached.config