add CMake switch for debug mode
formatting some CMakeLists to make them consistent