cmake: fix error in converting project variables to namespaced ones See merge request idf/esp-idf!3887