[CMake] Configured C header dependency problem

Alexander Neundorf a.neundorf-work at gmx.net
Wed Jul 28 18:25:57 EDT 2010


On Thursday 29 July 2010, Óscar Fuentes wrote:
> Óscar Fuentes <ofv at wanadoo.es> writes:
> > Alexander Neundorf <a.neundorf-work at gmx.net>
> >
> > writes:
> >>> 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:
> >>>
> >>> D:/dev/other/emacs/git/src/alloc.c
> >>> config.h
> >>> D:/dev/other/emacs/git/src/config.h
> >>
> >> This looks like it decided for D:/dev/other/emacs/git/src/config.h
> >> instead of D:/dev/other/emacs/qbuild/src/config.h .
> >> What's the exact compile command (from make VERBOSE=1) ?
> >
> > This is from Linux:
> >
> > cd /home/oscar/dev/other/emacs/qbuild/src && /usr/bin/gcc -Demacs
> > -DHAVE_CONFIG_H -I. -I/home/oscar/dev/other/emacs/qbuild/src
> > -I/home/oscar/dev/other/emacs/git/src -I/usr/include/freetype2 -o
> > CMakeFiles/qemacs.dir/alloc.c.o -c
> > /home/oscar/dev/other/emacs/git/src/alloc.c
>
> Since the C.includescache excerpt showed above is from MinGW, maybe it
> is is more clear to show the command of that build:
>
> cd D:\dev\other\emacs\qbuild\src && C:\apps\msys\1.0\mingw\bin\gcc.exe
> -Demacs -DHAVE_CONFIG_H -DHAVE_NTGUI -g
> -I. -ID:/dev/other/emacs/git/nt/inc -ID:/dev/other/emacs/qbuild/src

...not sure about that dot here.

Do you have something like
include_directories ( . )
in your CMakeLists.txt ?
Does it change something if you change this to 
include_directories ( ${CMAKE_CURRENT_BINARY_DIR} ) ?

Alex


More information about the CMake mailing list