Fixed cmake dependency handling