cmake: fix lib not populated and RPATH usage