Added a Cmake macro to test and set language as CXX if necessary