COMPILE_LANGUAGE genex works in file(GENERATE)
The following works:
cmake_minimum_required(VERSION 3.18)
project(generate_genex LANGUAGES CXX)
file(GENERATE OUTPUT test.txt CONTENT "$<$<COMPILE_LANGUAGE:CXX>:we're CXX>" CONDITION $<COMPILE_LANGUAGE:CXX>)
This doesn't make much sense as noted by Robert, because a file(GENERATE)
isn't a target so it doesn't have a language it's being compiled as.
Currently this seems to use the project-wide language. Seems unintentional and probably worth adding a policy to turn this into an error.