moved leak checking into CMakeList