cmake: second rebase

       more fixes
       version detection for submodules
       add support for build as subproject
       move .pc file to lib
       add include_dirs