# Read project version from cache

**URL:** https://discourse.cmake.org/t/read-project-version-from-cache/1849
**Category:** Usage
**Created:** [September 15, 2020, 9:42pm UTC](https://discourse.cmake.org/t/read-project-version-from-cache/1849 "2020-09-15T21:42:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![alex](https://discourse.cmake.org/user_avatar/discourse.cmake.org/alex/32/125_2.png) [@alex](https://discourse.cmake.org/u/alex)
#### Post date: [September 15, 2020, 9:42pm UTC](https://discourse.cmake.org/t/read-project-version-from-cache/1849/1 "2020-09-15T21:42:44Z")

</div>

See the following interaction:

```auto
alex@Alex-Desktop:~/Development/Halide-build$ grep VERSION CMakeCache.txt
CMAKE_PROJECT_VERSION:STATIC=12.0.0
CMAKE_PROJECT_VERSION_MAJOR:STATIC=12
CMAKE_PROJECT_VERSION_MINOR:STATIC=0
CMAKE_PROJECT_VERSION_PATCH:STATIC=0
CMAKE_PROJECT_VERSION_TWEAK:STATIC=
PYBIND11_PYTHON_VERSION:STRING=
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3
CMAKE_CACHE_MINOR_VERSION:INTERNAL=18
CMAKE_CACHE_PATCH_VERSION:INTERNAL=2
alex@Alex-Desktop:~/Development/Halide-build$ cmake -N -LA . | grep VERSION
PYBIND11_PYTHON_VERSION:STRING=

```

Why does `cmake -N -LA .` not show `CMAKE_PROJECT_VERSION`? Is there some way to get the version easily from the command line?

---

<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, 2020, 1:26pm UTC](https://discourse.cmake.org/t/read-project-version-from-cache/1849/2 "2020-11-19T13:26:37Z")

</div>

I suspect it has to do with the `STATIC` and `INTERNAL` types of those variables. I don’t think you can change them with `-D` which would indicate that they won’t be shown with `-LA`. I believe `grep` might be the way to go here.

---

<div class="post-metadata">

### Author: ![alex](https://discourse.cmake.org/user_avatar/discourse.cmake.org/alex/32/125_2.png) [@alex](https://discourse.cmake.org/u/alex)
#### Post date: [November 26, 2020, 1:48am UTC](https://discourse.cmake.org/t/read-project-version-from-cache/1849/3 "2020-11-26T01:48:00Z")

</div>

`grep` it is, then. Thanks.
