<HTML>
<HEAD>
<TITLE>configure_file without continuous re-build</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>We have a large-ish system. &nbsp;Deep within an included utility class, I have this code:<BR>
<BR>
CONFIGURE_FILE(${DCMTK_SOURCE_DIR}/osconfig.h.in<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${DCMTK_BINARY_DIR}/include/dcmtk/config/osconfig.h)<BR>
<BR>
However, every time I touch a CMake file, &#8220;osconfig.h&#8221; is regenerated, causing nearly the entire library to re-build because of dependancies. &nbsp;Is this a good/proper/recommended way to guard against regeneration of the file?<BR>
<BR>
# NB: you would need to delete the configured osconfig.h to re-generate.<BR>
if ( NOT EXISTS ${DCMTK_BINARY_DIR}/include/dcmtk/config/osconfig.h)<BR>
message ( STATUS &quot;Reconfigure&quot; )<BR>
CONFIGURE_FILE(${DCMTK_SOURCE_DIR}/osconfig.h.in<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${DCMTK_BINARY_DIR}/include/dcmtk/config/osconfig.h)<BR>
endif()<BR>
<BR>
<BR>
Or is there some little known, little documented CMake feature that I don&#8217;t know about?<BR>
<BR>
Thanks,<BR>
-dan<BR>
<BR>
-- <BR>
<B>Daniel Blezek, PhD<BR>
</B>Medical Imaging Informatics Innovation Center<BR>
<BR>
P 127 or (77) 8 8886<BR>
T 507 538 8886<BR>
E <a href="blezek.daniel@mayo.edu">blezek.daniel@mayo.edu</a><BR>
<BR>
Mayo Clinic<BR>
200 First St. S.W.<BR>
Harwick SL-44<BR>
Rochester, MN 55905<BR>
mayoclinic.org<BR>
<BR>
</SPAN></FONT>
</BODY>
</HTML>