Read middleware directly in CMake, instead of via middleware_name.sh