CMake Nightly Date Stamp
CMake Nightly Date Stamp
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.
CMake Nightly Date Stamp
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'.
Merge topic 'try_compile-targets' into next

7db5bd3 Handle targets in the LINK_LIBRARIES of try_compile.
9e2ec07 Add a new Export generator for IMPORTED targets.
dce8794 Keep track of all targets seen while evaluating a genex.
0ad58af CMake Nightly Date Stamp
77eccc2 CMake Nightly Date Stamp
Add a better error message.
Merge topic 'try_compile-targets' into next

8bbab24 Add a better error message.
Strip stray semicolons when evaluating 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.

As an unfortunate side-effect of backward compatibility for the
LINK_INTERFACE_LIBRARIES property, self references can no longer be errors.
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.
Fix constness of accessors.
Fix the tests for evaluating includes and defines.

We should also check whether the INTERFACE_ variant of a property
is being read, and in the case of the compile definitions, we should
test the _<CONFIG> suffixed variants.

This way, we use the ALREADY_SEEN optimization when evaluating
the includes of a target in 'external' generator expressions, ie, those
used in a add_custom_command invokation, as opposed to evaluating the
INCLUDE_DIRECTORIES of a target itself via GetIncludeDirectories.
Merge topic 'interface-property-external-read' into next

0626cf5 Fix the tests for evaluating includes and defines.
34ef6ea Fix constness of accessors.
a3a133e Expand includes and defines transitively in 'external' genexes.
953def1 Fix DAG checker finding cycling dependencies.
ec2c67b Strip stray semicolons when evaluating generator expressions.
a0ac2c5 CMake Nightly Date Stamp
Xcode: Fix nested source group handling (#12943)

Teach the code path for nested sources build the group map key in the
same way as non-nested code path does.
Xcode: Sort source files

Since Xcode doesn't sort the files on its own, let's sort them in our
generator to make navigation easier.  Visual Studio, QtCreator, and
kdevelop all display files sorted.
Fix style.
Delete entire CMakeFiles directory when deleting CMakeCache.txt (#13756)

Since commit e015df7d (...delete CMakeFiles directory when cache is
deleted, 2006-02-20) we deleted the files in the CMakeFiles directory
when deleting CMakeCache.txt in order to reset the build tree to a fresh
state.  This allowed commit fd33bf93 (fix for bug 6102, allow users to
change the compiler, 2007-12-13) to delete CMakeCache.txt when the user
changes the compiler and CMakeFiles/CMake<lang>Compiler.cmake and other
platform information files would go with it to allow a fresh start.

Then commit 7195aca5 (Make platform information files specific to the
CMake version, 2012-08-24) moved the platform information files to a
subdirectory e.g. CMakeFiles/<version>/CMake<lang>Compiler.cmake where
<version> is the current CMake version.  This causes the compiler change
logic to fail to remove all old compiler information.  Then on the next
configuration CMake<lang>Compiler.cmake would set CMAKE_<lang>_COMPILER
back to the old value and re-trigger the compiler change logic.  This
causes an infinite loop of cache deletion and compiler reset.

Fix this simply by teaching cmCacheManager::DeleteCache to remove the
entire CMakeFiles directory recursively whenever it removes an existing
CMakeCache.txt.  This fully resets the build tree to configure with a
fresh compiler.
Merge branch 'empty-compiler-crash' into compiler-change-cleanup