[CMake] Configured C header dependency problem
ofv at wanadoo.es
Wed Jul 28 12:20:59 EDT 2010
Eric Noulard <eric.noulard at gmail.com> writes:
> 2010/7/28 Óscar Fuentes <ofv at wanadoo.es>:
>> 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_executable(foo file1.c file2.c ...)
> Did you try adding the config.h to your list of files in add_executable ?
> Do not forget to
> set_source_files_properties(config.h PROPERTIES GENERATED TRUE)
Thanks for the suggestions. Just tried them, separately and combined. No
OTOH, I would expect from configure_file to automatically do that, and
from the depedency scanner to detect config.h.
>> This is what I do on other projects, without problems. Any suggestion?
> May be config.h is found in some add_executable/add_library for
> those project?
In the C.includescache file config.h is mentioned, twice. So the
dependency scanner detects the file, but then it is ignored. The
config.h file is in D:/dev/other/emacs/qbuild/src/config.h (the build
directory.) This is an excerpt of C.includescache:
More information about the CMake