<div class="gmail_quote">On Sat, Mar 21, 2009 at 10:01 PM, Robert Dailey <span dir="ltr"><<a href="mailto:rcdailey@gmail.com">rcdailey@gmail.com</a>></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;">
<div class="gmail_quote"><div><div></div><div class="h5">On Sat, Mar 21, 2009 at 7:42 PM, Philip Lowman <span dir="ltr"><<a href="mailto:philip@yhbt.com" target="_blank">philip@yhbt.com</a>></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;">
<div class="gmail_quote"><div><div></div><div>On Sat, Mar 21, 2009 at 8:00 PM, Robert Dailey <span dir="ltr"><<a href="mailto:rcdailey@gmail.com" target="_blank">rcdailey@gmail.com</a>></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;">
I currently have the following macro:<br><br><font face="'courier new', monospace">macro( get_conf_dependencies var_name project_name debug )<br> if( debug )<br> message( "Using DEBUG" )<br>
set( ${var_name} ${${project_name}_DEBUG_DEPENDENCIES} )<br> else()<br> set( ${var_name} ${${project_name}_RELEASE_DEPENDENCIES} )<br> endif()<br>endmacro()</font><div><font size="2" face="'courier new'"><span style="font-size: 10px;"><br>
</span></font></div>I then call the macro in two particular ways:<div><br></div><div><font face="'courier new', monospace">get_conf_dependencies( myVar myProject TRUE )</font></div><font face="'courier new', monospace">get_conf_dependencies( myVar myProject FALSE )</font><div>
<br></div><div>In both cases, I <b><i>do not</i></b> get the message "Using DEBUG". Are my eyes playing tricks on me, or is CMake not processing trivial boolean logic properly in its conditionals? I'm using version 2.6.3.</div>
</blockquote></div></div><div><br>I ran into the same issue a while back. Use a function() or actual variables in your call to get_conf_dependencies.<br><a href="http://public.kitware.com/Bug/view.php?id=8397" style="text-decoration: none;" target="_blank"><span style="text-decoration: underline;">http://public.kitware.com/Bug/</span>view.php?id=8397</a></div>
</div></blockquote><div><br></div></div></div><div>What do you mean by "actual variables"? </div></div>
</blockquote></div><br>You could do this:<br><br>set(myBool TRUE)<br>get_conf_dependencies(myVar myProject myBool)<br>...provided you change "if(debug)" to "if(${debug})" in your macro.<br><br>Making it a function() and using PARENT_SCOPE is probably a cleaner option:<br>
<font face="'courier new', monospace">set( ${var_name} ${${project_name}_RELEASE_DEPENDENCIES} PARENT_SCOPE)</font><br><br>-- <br>Philip Lowman<br>