<div class="gmail_quote">On Wed, Mar 4, 2009 at 3:21 PM, Bill O&#39;Hara <span dir="ltr">&lt;<a href="mailto:billtohara@gmail.com">billtohara@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi All,<br><br>Say I have a CMakeLists.txt that  does<br><br>add_definitions(-DFOO=1)<br>add_subdirectory(bar)<br><br>and in bar the CMakeLists.txt does<br><br>add_definitions(-DFOO=2)<br><br>The intention being that the code in the subdirectory needs the different definition of FOO. Is there a straightforward way to temporarily override the -DFOO? That is, when we go back up to the parent that -DFOO=1 now has effect? My naive attempt above means that -DFOO=1 -DFOO=2 ends up in the compiler arguments which causes things to break (the compiler doesn&#39;t like FOO being redefined like that).<br>

<br>Any hints?</blockquote><div><br>Have you tried remove_definitions()?<br></div></div><br>-- <br>Philip Lowman<br>