fixed cmake for external usage