Cmake package

Extends the cmake_package to handle all the issues raised in #159.