"If" syntax for post-build macros in VS 2010
Asked Answered
F

1

15

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?

Fourgon answered 6/12, 2011 at 3:52 Comment(0)
F
27

Just figured out:

if not $(ConfigurationName) == Debug  
   copy /y $(ProjectDir)memcached.$(ConfigurationName).config 
           $(ProjectDir)memcached.config
Fourgon answered 6/12, 2011 at 4:2 Comment(1)
Thanks. Was driving me nuts! Tried <>, != !($(x)==x). you would think != would be it since they use ==.Neuritis

© 2022 - 2024 — McMap. All rights reserved.