# How to Solve this Parse error ??

**URL:** https://discourse.cmake.org/t/how-to-solve-this-parse-error/4890
**Category:** Development
**Created:** [January 24, 2022, 8:07am UTC](https://discourse.cmake.org/t/how-to-solve-this-parse-error/4890 "2022-01-24T08:07:38Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![vasantharaj](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/v/bcef8e/32.png) [@vasantharaj](https://discourse.cmake.org/u/vasantharaj)
#### Post date: [January 24, 2022, 8:07am UTC](https://discourse.cmake.org/t/how-to-solve-this-parse-error/4890/1 "2022-01-24T08:07:38Z")

</div>

CMake Error at CMakeLists.txt:19:  
Parse error. Expected a command name, got unquoted argument with text “$”.

– Configuring incomplete, errors occurred!

Code Here::  
set(all ${MAKE\_TARGETS})

$(foreach BG, $(BGROUPS), $(file \>\>MAKETMP\_tsvar.in,$(if $(OBJECTS\_$(BG)_C\_NODIR\_OBJ), $(OBJECTS_$(BG)_C\_NODIR\_OBJ) : CFLAGS := $(CFLAGS_$(BG)),)))

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [January 24, 2022, 12:31pm UTC](https://discourse.cmake.org/t/how-to-solve-this-parse-error/4890/2 "2022-01-24T12:31:18Z")

</div>

You cannot use Makefile syntax in CMake. You’ll need to use a `foreach` loop and handle this expansion in CMake code instead.
