Added uninstall target check to cmakelists (cherry picked from commit f0e79bafd8823aedf535e9b344d4cf9a4f9747e5)