add top-level CMake
minor changes in this + changes to make it pass CMakeLint