[CMake] Prevent make (linux) from fowling dependencies out of cwd

Michael Wild themiwi at gmail.com
Fri Feb 25 02:45:16 EST 2011


On 02/25/2011 04:58 AM, Mark Miller wrote:
> I am on a large project that uses CMake. I do my development primarily
> on Linux. Prior to introduction of CMake, the makefiles we produced
> would be such that I could cd into some directory and type something
> like 'make -j 4' and it would make everything in that directory AND ONLY
> that directory, in parallel.
> 
> However, now with the Makefiles that CMake is producing, that is no
> longer possible. Or, at least I don't know how to invoke either CMake
> (to generate the Makefiles) or perhaps make with appropriate variable(s)
> set to affect desired behavior.
> 
> Does anyone know of a way to do this? Is there a way to invoke CMake
> such that the resulting Makefiles do not 'follow dependencies' out of
> cwd? Or, are there maybe some Make variables CMake defines that I can
> then pass to Make to prevent it from following dependencies out of cwd?
> 
> I suppose I'd even accept a solution that required (minor) adjustments
> to top-level CMakeLists.txt file to affect this behavior.
> 
> Thanks in advance for any help.
> 
> Mark

If you don't follow the dependencies, your output will be broken. What
you can do, though, is use the */fast targets to disable dependency
tracking for the specified targets.

Michael


More information about the CMake mailing list