install(EXPORT): Breaks when a target is named C or CXX
The project
cmake_minimum_required(VERSION 3.0)
project(ExportC C)
add_library(A a.c)
install(TARGETS A EXPORT foo)
install(EXPORT foo DESTINATION lib/cmake/foo)
export(TARGETS A FILE Export.cmake)
add_executable(C c.c)
fails to configure with
CMake Error: install(EXPORT "foo" ...) includes target "A" which requires target "C" that is not in any export set.
CMake Error in CMakeLists.txt:
export called with target "A" which requires target "C" that is not in any
export set.