On Tue, Mar 31, 2009 at 9:45 AM, Bill Hoffman <span dir="ltr"><<a href="mailto:bill.hoffman@kitware.com">bill.hoffman@kitware.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
James Bigler wrote:<br>
<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="im">
<br>
<br>
If this feature comes to fruition, I would like the ability to specify which flags make it into what header. In one project I worked on all our configuration defines were in a single header. This caused extremely long recompiles if something happened to change the one autoheader. We eventually broke it into multiple files, and got targeted recompiles.<br>
<br></div>
I also like the idea of not having to have a <a href="http://configure.h.in" target="_blank">configure.h.in</a> <<a href="http://configure.h.in" target="_blank">http://configure.h.in</a>> file like Hendrik Sattler suggested (put these variables in this header here).<br>
<br>
</blockquote>
Do you have an API suggestion? What should this look like?<br><font color="#888888">
<br>
-Bill<br>
<br>
</font></blockquote></div><br>Why not something similar to what you proposed, but without the intermediate <a href="http://configure.h.in">configure.h.in</a> step and being able to specify comments and perhaps custom strings. You could also specify things multiple kinds and they all just get inserted one after the other. CMake could generate the .in file and use configure_file in the background. The point is that you don't have to maintain two files.<br>
<br><span style="font-family: courier new,monospace;">set(VARS HAS_A HAS_B HAS_C)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
set(STRING_VARS STRING_A STRING_B)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
cmake_autoheader(</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> CMAKEDEFINE_VARS ${VARS}</span><br style="font-family: courier new,monospace;"><div style="font-family: courier new,monospace;" id=":3a1" class="ii gt">
STRING_VARS ${STRING_VARS}<br> CUSTOM_VAR "#define \"I like @MY_VAR@\"<br> COMMENT "Here's a comment"<br> CMAKEDEFINE_VARS "SOME_OTHER_VAR;AND_ANOTHER;"<br>
HEADER ${CMAKE_BINARY_DIR}/include<font size="2">/config.h</font><br> )</div><br>