export: Multiple calls for same output FILE not diagnosed
The code
add_library(foo INTERFACE)
export(TARGETS foo FILE foo.cmake)
export(TARGETS foo FILE foo.cmake)
is accepted but should be an error without the APPEND
option. Projects may be using such code with different targets listed and silently exporting only the last call's targets.
This example came up while investigating #20469 (closed). That issue was addressed for CMake 3.17 only by fixing the crash to restore CMake <= 3.16 behavior of accepting the code.