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't like FOO being redefined like that).<br>
<br>Any hints?<br><br>thanks<br>b.<br>