Support compiling the same file using multiple languages
While usually files can be uniquely attributed a
LANGUAGE, that is not universally the case. There are many non-esoteric cases in which the same file can be interpreted in multiple language; with the most common one being C and C++; and perhaps that can be extended to C, C++, OpenCL C and CUDA C++. I suppose there might be other such combinations, perhaps in the Java world or for some scripting language.
CMake should support the possibility of considering the same file using different languages.
My specific suggestion is that LANGUAGE be a binary property of a target and a file, defaulting to the file's
LANGUAGE if it is set, or its inferred language.