When running in script mode it is possible to run multiple separate
dashboard submissions in one cmCTest instance. The recent refactoring
of file submission lists into parts failed to clear the submission lists
when starting a new dashboard (ctest_start or ctest_update). Only the
unused old submission set was cleared. This fixes the refactored
version to remove the old submission set completely and also clear the
part-wise lists.
We need to initialize cmCTestSubmitHandler on construction to make sure
all parts get enabled by default. The recent fix to re-enable all parts
on initialization broke submit-only operations because the handler did
not initialize on construction. This also removes duplicate
initialization code.
Isolation of policy changes inside scripts is important for protecting
the including context. This teaches include() and find_package() to
imply a cmake_policy(PUSH) and cmake_policy(POP) around the scripts they
load, with a NO_POLICY_SCOPE option to disable the behavior. This also
creates CMake Policy CMP0011 to provide compatibility. See issue #8192.
This teaches functions and macros to use policies recorded at creation
time when they are invoked. It restores the policies as a weak policy
stack entry so that any policies set by a function escape to its caller
as before.
This re-organizes the discussion of the policy stack in documentation of
the cmake_policy() command. The new organization clearer and easier to
extend with new information.
A 'weak' poilcy stack entry responds normally to queries. However,
setting a policy in a weak entry will recursively set the policy in the
next entry too. This also gives the internal interface to create a weak
entry the option to provide an initial PolicyMap for it.
This makes cmMakefile::PushPolicy and cmMakefile::PopPolicy private so
that any outside place that uses them needs to use the PolicyPushPop
helper in an automatic variable. We grant an exception to
cmCMakePolicyCommand so it can implement cmake_policy(PUSH) and
cmake_policy(POP).
This creates cmMakefile::PolicyPushPop to push and pop policy scope
automatically. It also enforces balanced push/pop pairs inside the
scope it handles.
This defines PolicyMap as a public member of cmPolicies. Its previous
role as a policy stack entry is now called PolicyStackEntry and
represented as a class to which more information can be added later.
The previous change to order projects in the VS IDE did not account for
duplicate target names (such as ALL_BUILD and ZERO_CHECK) among the
input set. While we suppress generation of the duplicate project
entries, we need to use a multiset to store ordered duplicates.
The previous change to make ALL_BUILD come first among targets did not
account for comparing the target name against itself. This led to an
invalid ordering of the target set. This change fixes it.
This teaches the VS IDE generators to write ALL_BUILD into solution
files first so that it is always the default active project. Previously
it was first only if no target name sorted lexicographically earlier.
See issue #8172.
Our implementation of the feature to pull in dependent targets in VS
solution files for subprojects caused the order of project files in the
solution to be arbitrary (based on pointer value in the representation).
Target ordering in solution files is important to prevent unnecessary
changing of the files and because the VS IDE selects the first project
listed as the default active target. This change restores lexicographic
order by target name.