fix invoking cmake only once