How can I pass the -x c++ flag to the compiler (clang++/g++) with cMake?
Have a look at the LANGUAGE source property.