Add Atlas detection to cmake
this fixes issue #1394