Support for latest CMake (@clemenci)
Cherry-picked from !1338 (merged) on 2016-patches
, including also !1355 (merged) and !1726 (merged)
Edited by Marco Cattaneo
Cherry-picked from !1338 (merged) on 2016-patches
, including also !1355 (merged) and !1726 (merged)