Strip stray semicolons when evaluating generator expressions.
Fix GenerateExportHeader documentation #13936

There is no CMAKE_CURRENT_BUILD_DIR. CMAKE_CURRENT_BINARY_DIR is
the correct variable here.
Removed GenerateExportHeader warnings about old compilers

These warnings tend to flood the dashboard submissions, and it is doing
what it should (degrade gracefully with older compilers).
cmLocalGenerator: remove "virtual" where not used

This patch makes several functions of cmLocalGenerator which are marked
as virtual non-virtual, since they are not reimplemented anywhere.

Alex
export files: rewrite the code for checking required targets

Instead of generating a whole bunch of repeated if-statements
now a foreach()-loop is generated in the targets-file.
Also now a comment is inserted in the generated file if no
targets from other export sets are used, so if somebody looks
at the file he can see whether the information about missing
imported targets has been generated or not.

Alex
Tests: Replace exec_program with execute_process

Drop use of the old exec_program command from CMake's own CMakeLists.txt
files.
Tests: Generalize decision for 'make' tool supporting spaces

Some make tools do not support spaces inside the source tree paths.
Decide early whether to add tests that depend on support for spaces so
we can use the result in a decision for any test.
ExternalData: Test content link with a space in its name

Extend the Module.ExternalData test to cover a DATA{} reference whose
name contains a space.  Skip the case when the native build tool does
not support spaces.
automoc: Add source file to target early to set the linker language

Previously, GetIncludeDirectories was called before calling
target->AddSourceFile(mocCppSource). Since commit a1c4905f (Use the
link information as a source of compile definitions and
includes., 2013-02-12), the include directories are determined by
the link information.

Valid link information requires that the linker language can be
determined, which depends on the source files languages and the
dependent targets languages. In the case of the no_link_languages
target in the unit test, there are no dependencies and the additional
source file no_link_languages_automoc.cpp is added to the target
at generate-time. That file can be used to determine the linker
language, but it must be added to the target before calling
GetIncludeDirectories.
FPHSA: Add FOUND_VAR option to specify _FOUND variable name

In the new mode FPHSA now accepts a FOUND_VAR option, which can be set
either to ExactCase_FOUND or UPPERCASE_FOUND, no other values are
accepted.  Also add tests for that, including failure.

Alex
FPHSA: improve documentation

Alex
Keep track of all targets seen while evaluating a genex.

As dependencies of the generator expression, these will re-exported
in try_compile generated code.
Add a new Export generator for IMPORTED targets.

This is to be used during try_compile using LINK_LIBRARIES in the
srcfile signature and, in the future, TARGETS in the binary dir
signature.
Handle targets in the LINK_LIBRARIES of try_compile.

Imported targets are re-exported so that they can be used by the
try_compile generated code with target_link_libraries.

This makes the use of the cmake_expand_imported_targets macro
obsolete. The macro is not able to expand the generator expressions
which may appear in the IMPORTED_LINK_INTERFACE_LIBRARIES content.
Instead it just sees them as 'not a target'.
FPHSA: Convert FOUND_VAR failure test to RunCMake

Move the Tests/FPHSA_InvalidFOUND_VAR test case over to a new
RunCMake.FPHSA test with a BadFoundVar case.  The RunCMake tests are
built to cover failure cases easily and robustly.
VS: Restore CMAKE_GENERATOR_FC variable

In commit bed6c388 (VS,Xcode: Remove unused CMAKE_GENERATOR_* variables,
2013-02-19) we removed this variable among others from the VS generator
claiming they were all not used.  In fact the Fortran compiler detection
module CMakeDetermineFortranCompiler.cmake uses CMAKE_GENERATOR_FC even
for the Visual Studio IDE generators because it does not use the full
IDE compiler id detection like the C and C++ language files do.
Workaround broken code where a target has itself in its link iface.

There is a test for this since commit 8e756d2b (Tolerate cycles in
shared library link interfaces (#12647), 2012-01-12), so make sure
it continues to pass, even as we require no self-references in new
INTERFACE_ property generator expressions.
Fix DAG checker finding cycling dependencies.

Before this patch, the following is reported falsely as a self-reference:

 target_link_libraries(empty2 LINK_PUBLIC empty3)
 target_link_libraries(empty3 LINK_PUBLIC empty2)

 add_custom_target(...
    -DINCLUDES=$<TARGET_PROPERTY:empty2,INTERFACE_INCLUDE_DIRECTORIES>
 )

The reason is that the existing code assumed that all reading of
include directories would be done through cmTarget::GetIncludeDirectories()
and would therefore be initialized with a DagChecker. That is not the case
if reading the property with an 'external' generator expression.
Expand includes and defines transitively in 'external' genexes.

This means that we can use expressions of the form

 $<TARGET_PROPERTY:foo,INTERFACE_INCLUDE_DIRECTORIES>

to get a list of the interface include directories of foo, including
those coming from dependencies.

We can't have a test of a target which has a single include directory in
its INCLUDE_DIRECTORIES because the shell on the MSYS platforms transforms
a single include directory to include a prefix, which is not what the test
expects. We test a target with two directories instead as a means to
test a target with no link dependencies.
Fix constness of accessors.