# CMake adding quotes to ./configure commands?

**URL:** <https://discourse.cmake.org/t/cmake-adding-quotes-to-configure-commands/15383>\
**Category:** Code\
**Created:** [December 10, 2025, 5:38am UTC](https://discourse.cmake.org/t/cmake-adding-quotes-to-configure-commands/15383 "2025-12-10T05:38:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bchapman23](https://discourse.cmake.org/user_avatar/discourse.cmake.org/bchapman23/32/5939_2.png) [@bchapman23](https://discourse.cmake.org/u/bchapman23)\
**Post date:** [December 10, 2025, 5:38am UTC](https://discourse.cmake.org/t/cmake-adding-quotes-to-configure-commands/15383/1 "2025-12-10T05:38:42Z")

</div>

Hello,

I am trying to use CMake to build PETSc. However, when using the following configure command

set(PETSC\_CONFIG\_COMMAND

```
    ./configure \[other flags\] LDFLAGS="-L${LLVM_PATH}/lib/clang/17/lib/linux/ -lclang_rt.builtins-x86_64")

```

It gets parsed into the configure options as ““-L${LLVM\_PATH}/lib/clang/17/lib/linux/ -lclang\_rt.builtins-x86\_64”“, with the double quotes at the end messing everything up. My Googling has suggested this is an issue with how CMake parses the arguments here, but I couldn’t find a solution.

Would anyone know a way to ensure CMake doesn’t add extra quotes here? Environment variables are not an option as they cause unwanted behaviour elsewhere.

---

<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:** [February 9, 2026, 5:10am UTC](https://discourse.cmake.org/t/cmake-adding-quotes-to-configure-commands/15383/2 "2026-02-09T05:10:47Z")

</div>

> [@bchapman23](#):
>
> `LDFLAGS="-L${LLVM_PATH}/lib/clang/17/lib/linux/ -lclang_rt.builtins-x86_64"`

CMake is not bash. Inner quotes are literal.

I think you want:

```cmake
"LDFLAGS=-L${LLVM_PATH}/lib/clang/17/lib/linux/ -lclang_rt.builtins-x86_64"

```
