Fixed linking with CMake