# Difference between quote and non-quote variable

**URL:** <https://discourse.cmake.org/t/difference-between-quote-and-non-quote-variable/6906>\
**Category:** Code\
**Created:** [November 19, 2022, 5:03am UTC](https://discourse.cmake.org/t/difference-between-quote-and-non-quote-variable/6906 "2022-11-19T05:03:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nitro2](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/n/e9a140/32.png) [@nitro2](https://discourse.cmake.org/u/nitro2)\
**Post date:** [November 19, 2022, 5:03am UTC](https://discourse.cmake.org/t/difference-between-quote-and-non-quote-variable/6906/1 "2022-11-19T05:03:35Z")

</div>

In [Cmake tutorial](https://cmake.org/cmake/help/latest/guide/tutorial/Adding%20a%20Library.html), solution for TODO 10:

```cmake
target_include_directories(Tutorial PUBLIC
                           "${PROJECT_BINARY_DIR}"
                           ${EXTRA_INCLUDES}
                           )

```

I wonder what is difference between `"${PROJECT_BINARY_DIR}"` and `${PROJECT_BINARY_DIR}`?  
Why are we using quote on the `PROJECT_BINARY_DIR` but not in `EXTRA_INCLUDES`?  
I see both work. Which is recommendation for using variable?

---

<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:** [November 19, 2022, 11:11pm UTC](https://discourse.cmake.org/t/difference-between-quote-and-non-quote-variable/6906/2 "2022-11-19T23:11:26Z")

</div>

My rule is “always quote unless it’s expanding into an argument list”. So `PROJECT_BINARY_DIR` is always a single argument, but `EXTRA_INCLUDES` can be a _list_ of directories. If this were quoted, the entire list would be treated as a single include path (embedded `;`s and all).
