[Cmake] Disabling cmake.check_depends

Brad King brad . king at kitware . com
Thu, 11 Sep 2003 09:16:18 -0400 (EDT)


> I am using cmake 1.6.7 to build a project. Every time I make a change to
> a source file, and call make, cmake.check_depends is built. This takes
> far longer than what it takes to build the single .o file that I am
> testing, since my dependency tree is quite big (my code + VXL library
> source). Is there a way of disabling the dependency check, or to limit
> the check to the local directory?

You can stop dependency checking from going outside your project by
specifying a regular expression of header names.  Only headers matching
the regex will be explored.  The regex is specified in a CMakeLists.txt
file with this command:

  INCLUDE_REGULAR_EXPRESSION
       Set the regular expression used for dependency checking.

         INCLUDE_REGULAR_EXPRESSION(regex_match [regex_complain])

       Set the regular expressions used in dependency checking.  Only files
       matching regex_match will be traced as dependencies.  Only files
       matching regex_complain will generate warnings if they cannot be found
       (standard header paths are not searched).  The defaults are:

         regex_match    = "^.*$" (match everything)
         regex_complain = "^$" (match empty string only)

If there is no common prefix to your headers, you can at least stop it
from exploring vxl with a regex something like this (untested):

INCLUDE_REGULAR_EXPRESSION("^[^v].*|v[^n].*")

-Brad