Define a "check_language(<lang>)" macro to test whether <lang> can be enabled. Cache the result in CMAKE_<lang>_COMPILER. Add a test case covering expected results.