[CMake] Intended behavior; header files in directory change should cause rebuild?

J Decker d3ck0r at gmail.com
Tue Jun 21 19:25:35 EDT 2011


On Tue, Jun 21, 2011 at 4:18 AM, David Cole <david.cole at kitware.com> wrote:
> On Tue, Jun 21, 2011 at 5:11 AM, J Decker <d3ck0r at gmail.com> wrote:
>>
>> Okay I have many many projects and targets using cmake to build them.
>>
>> I target openwatcom stock install, mingw stock install, and vs2010
>> stock install + cmake + my sources
>>
>> Often when I make a change to sack/includes/*.h everything rebuilds
>> appropriately.
>> If I change a header in a library that's local and included with
>> "something.h" (?I think?) I don't know specifically which
>> misbehave.... but before I declare it's a fault, I wondered if header
>> dependancies were something that cmake was supposed to make rules for.
>>
>> It's gotten me a couple times recently where I made a change in a
>> header that didn't cause a recompile.  I think I have a candidate that
>> demonstrates it if I need to look into it further?
>>
>> On Tue, Jun 21, 2011 at 2:02 AM, Michael Wild <themiwi at gmail.com> wrote:
>> > On 06/21/2011 10:51 AM, J Decker wrote:
>> >> header files in directory change should cause rebuild?
>> >> Doesn't cmake parse the c files for includes and auto build header
>> >> dependancies?
>> >
>> >
>> > Sorry, can you rephrase your question? Preferably using complete
>> > sentences, so people are actually are able to follow...
>> >
>> >
>> > Micheal
>> >
>> > _______________________________________________
>> > 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
>
> CMake generates makefiles that have dependency info in them based on a
> built-in dependency scanner that looks for "#include" lines in source files.
> But for build systems like Xcode and Visual Studio, it trusts those systems
> to do the scanning without doing that scanning.
> So... is your problem with the makefile based build trees, or the Visual
> Studio build tree? If Visual Studio, complain to Microsoft. If makefile,
> then give some more info so we can figure out where the problem is.
>

Okay; probably is a visual studio specific issue... maybe I'm
confusing it because I'm copying 80% of the .C's to .cpp in
CMAKE_BINARY_DIR/... and I also copy those headers.  Although the
regular project for the C files shouldn't be aware of each other's
original source directories, maybe because both are in the same
solution it causes vs to get confused?  Thanx though, I'll figure out
the condition and report to microsoft.

just an observation ; gcc can generate dependancies as it is
compiling, if these dependancies are included in make with

-include file.depends.d

then it doesn't fail during first build when there is none; anyhow
that removes the nessecity to scan the files yourself.  OpenWatcom
also supports generation of dependancies during the compilation
process.



> Thx,
> David
>


More information about the CMake mailing list