[Regression] Misleading error message with NEW CMP0037
Commit 7a4c02cb changed the way the error message for CMP0037 is emitted, leading to somewhat misleading error messages when ALIAS libraries are involved: instead of printing the actual reserved name, the message displays the name of the resolved target.
cmake_minimum_required(VERSION 3.27)
project(test_cmp0037)
include(CTest)
add_library(icutest INTERFACE)
add_library(test ALIAS icutest)
With cmake 3.27.6, this code generates the error
CMake Error at CMakeLists.txt:7 (add_library):
The target name "test" is reserved when CTest testing is enabled.
but with cmake 3.29.3, it prints
CMake Error at CMakeLists.txt:7 (add_library):
The target name "icutest" is reserved when CTest testing is enabled.