adding reference CMake implementation