Use the CMAKE_MATCH_* variables to simplify matching logic. Match
either 3 or 4 version components. Do not fail when there are only three
components available.
Allow directories in the source tree or build tree only if the
install tree is a subdirectory of the source tree or build tree,
as appropriate.
Re-use the test files in the RunCMake.include_directories test
to run in multiple scenarios. Bump the required CMake version
in the test to 3.0 to ensure that the new policy warnings are
emitted correctly.
The AddSource method accepts one file and tries to avoiding adding
it to the sources-list of the target if it already exists. This
involves creating many cmSourceFileLocation objects for matching
on existing files, which is an expensive operation.
Avoid the searching algorithm by appending the new sources as one
group. Generate-time processing of source files will ensure
uniqueness.
Add a new AddTracedSources for this purpose. The existing
AddSources method must process the input for policy CMP0049, but
as these source filenames come from cmSourceFile::GetFullPath(),
we can forego that extra processing.
Computing the language involves computing the source files, which
is an expensive operation. It requires calling
cmMakefile::GetOrCreateSource many times, which involves creating
and matching on many cmSourceFileLocation objects.
Source files of a target may depend on the head-target and the
config as of commit e6971df6 (cmTarget: Make the source files depend
on the config., 2014-02-13). The results are cached for each context
as of commit c5b26f3b (cmTarget: Cache the cmSourceFiles in
GetSourceFiles., 2014-04-05).
Each target in the build graph causes language computation of all
of its dependents with itself as the head-target. This means that
for 'core' libraries on which everything depends, the source files
are computed once for every transitive target-level-dependee and
the result is not cached because the head-target is different. This
was observed in the VTK buildsystem.
Short circuit the computation for targets which have a source-list
that is independent of the head-target. If the source-list has
already been computed and the generator expression evaluation
reports that it was context-independent, return the only source-list
already cached for the target. Reset the short-circuit logic when
sources are added and when the link libraries are re-computed.
Extract upstream KWSys using the following shell commands.
$ git archive --prefix=upstream-kwsys/ 8b085635 | tar x
$ git shortlog --no-merges --abbrev=8 --format='%h %s' 39f98b5d..8b085635
Rolf Eike Beer (2):
a99a9235 set the compile flags for older HP compilers to fix compilation
8b085635 MD5: avoid casting back and forth between size_t and int
Change-Id: I6386b521dbaba2e4f9ed5b2be34a504b9c17fc36
Follow up commit 1de08685 (cmSystemTools: Restore unreachable return to
silence warnings, 2014-04-02) by excluding the unreachable return on the
HP compiler as well as Clang. Both recognize that it is unreachable and
warn.