cmSourceFileLocation: Avoid string allocation in extension checking

The substr call was causing excess allocations. Swap the cheaper
character check to be before the longer string comparison, now using the
prefix checking function.
cmSourceFileLocation: Simplify logic in Matches
cmSourceFileLocation: Save some string copies
cmSourceFileLocation: Return a string reference
cmSourceFile: Cache the isUiFile check

The filename extension call is expensive, so cache the .ui check.
perf: Cache the language property string
cmSourceFile: Take a string
cmMakefile: Use a hashmap for imported targets
cmGlobalGenerator: Store targets in hash maps
Features: Make CMAKE_CXX_KNOWN_FEATURES a property.

As a 'built-in' variable it imposes a cost on all variable lookups
and it is expected to be rarely used.
Revert "Add the WriteCompilerDetectionHeader module."

This reverts commit 50d43cf5555f98c3811bd7897eb43bc27bf8d215.
Merge topic 'WriteCompilerDetectionHeader-module' into next

f9e85b9a Revert "Add the WriteCompilerDetectionHeader module."
Merge topic 'CMAKE_CXX_KNOWN_FEATURES-global-property' into next

feca7408 Features: Make CMAKE_CXX_KNOWN_FEATURES a property.
Fix feature tests.
Merge topic 'CMAKE_CXX_KNOWN_FEATURES-global-property' into next

e7c0ef11 Fix feature tests.
Features: Make CMAKE_CXX_KNOWN_FEATURES a property.

As a 'built-in' variable it imposes a cost on all variable lookups
and it is expected to be rarely used.
Merge topic 'CMAKE_CXX_KNOWN_FEATURES-global-property' into next

3fdfa5d3 Features: Make CMAKE_CXX_KNOWN_FEATURES a property.
Project: Clarify comment about platform-native compilers.
Project: Generate the CXX compiler Id test from multiple files.

This will allow sharing of the logic of the order to test compilers in
and the preprocessor macros used to do that and to determine the
version components.
Project: Split the compiler id detection into a separate function.

This can be extended with parameters to control the output and re-used
in other contexts.