title: What's the idiomatic way to compile the same file twice, with different languages?
body: <p>I have a source file which is valid in (at least) two languages. Say, C and C++ or C and CUDA.</p>
  <p>I want to compile this file in both languages, each time into a different library. What's the idiomatic way of doing this in recent versions of CMake?</p>
  <p>Notes:</p>
  <ul>
  <li>If the specific version of CMake matters, please specify which minimum version I would need.</li>
  <li>Related: <a href="https://stackoverflow.com/q/31720927/1593077">How can I configure cmake to compile a file twice with two different compilers?</a></li>
  </ul>