The problem is that you split the generator expression across multiple lines, which creates whitespace that CMake then interprets as a separator between arguments. What CMake sees is the following four separate arguments, not a single argument with a valid generator expression:
"$<BUILD_INTERFACE:"
"${CMAKE_SOURCE_DIR}/include1"
"${CMAKE_SOURCE_DIR}/include2"
">"
Unfortunately, CMake doesn’t warn when an argument looks like the beginning of a generator expression but is not in fact a valid generator expression (i.e. it is missing the closing >
).