Fix warnings on mains, add cmake installation system