Restricting cmake to CXX does not always work