you shouldn't have to do that. There are multitudes of projects that do exactly what you are doing and don't have continuous rebuilds. Now, having said that I am _assuming_ that osconfig.h.in is NOT being changed, generated, updated or in any way changed? osconfig.h.in being changed would cause "configure_file()" to re-run which will regenerate the osconfig.h file.

Early in the HDF5/CMake port we were doing exactly that which caused HDF5 to be rebuilt just about completely because the "H5conf.h" file was always being generated at cmake time.

_________________________________________________________
Mike Jackson                  mike.jack...@bluequartz.net
BlueQuartz Software                    www.bluequartz.net
Principal Software Engineer                  Dayton, Ohio

On Jan 12, 2010, at 3:51 PM, Tyler Roscoe wrote:

On Tue, Jan 12, 2010 at 02:09:36PM -0600, Daniel Blezek wrote:
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?

You could configure_file() to a temporary location, then
'cmake -E copy_if_different' from the temp location to the real
location. This way, the real osconfig.h is only updated (and the
dependent parts of the build are re-compiled) if something has changed.

tyler
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to