[CMake] Configured C header dependency problem

Óscar Fuentes ofv at wanadoo.es
Tue Jul 27 20:26:21 EDT 2010


I'm using cmake 2.8.2 on Linux/make and on Windows/make-mingw32

The project configures a template config.cmake producing config.h. That
header is included by all C files on the project.

While building in-source, touching config.h only triggers the rebuild if
config.h is included as

#include "config.h"

but not as

#include <config.h>

While building out of source, touching config.h does not trigger the
rebuild of the C files not matter how the header is used.

Touching any other header file triggers the rebuild of the corresponding
C source files.

The project follows the pattern

platform macros
configure config.cmake -> config.h (using configure_file)
add_subdirectory
add_executable(foo file1.c file2.c ...)

This is what I do on other projects, without problems. Any suggestion?



More information about the CMake mailing list