[CMake] configure_file without continuous re-build
Daniel Blezek
Blezek.Daniel at mayo.edu
Tue Jan 12 15:09:36 EST 2010
We have a large-ish system. Deep within an included utility class, I have
this code:
CONFIGURE_FILE(${DCMTK_SOURCE_DIR}/osconfig.h.in
${DCMTK_BINARY_DIR}/include/dcmtk/config/osconfig.h)
However, every time I touch a CMake file, ³osconfig.h² is regenerated,
causing nearly the entire library to re-build because of dependancies. Is
this a good/proper/recommended way to guard against regeneration of the
file?
# NB: you would need to delete the configured osconfig.h to re-generate.
if ( NOT EXISTS ${DCMTK_BINARY_DIR}/include/dcmtk/config/osconfig.h)
message ( STATUS "Reconfigure" )
CONFIGURE_FILE(${DCMTK_SOURCE_DIR}/osconfig.h.in
${DCMTK_BINARY_DIR}/include/dcmtk/config/osconfig.h)
endif()
Or is there some little known, little documented CMake feature that I don¹t
know about?
Thanks,
-dan
--
Daniel Blezek, PhD
Medical Imaging Informatics Innovation Center
P 127 or (77) 8 8886
T 507 538 8886
E blezek.daniel at mayo.edu
Mayo Clinic
200 First St. S.W.
Harwick SL-44
Rochester, MN 55905
mayoclinic.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100112/696eed07/attachment.htm>
More information about the CMake
mailing list