# Question about failure result of get\_target\_property

**URL:** <https://discourse.cmake.org/t/question-about-failure-result-of-get-target-property/1384>\
**Category:** Code\
**Created:** [June 12, 2020, 7:41pm UTC](https://discourse.cmake.org/t/question-about-failure-result-of-get-target-property/1384 "2020-06-12T19:41:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![christetreault](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/c/f475e1/32.png) [@christetreault](https://discourse.cmake.org/u/christetreault)\
**Post date:** [June 12, 2020, 7:41pm UTC](https://discourse.cmake.org/t/question-about-failure-result-of-get-target-property/1384/1 "2020-06-12T19:41:44Z")

</div>

I’m trying to troubleshoot an issue with a VS project generated by CMake. The relevant section of the cmake file is:

```auto
  get_target_property(test_suite_folder ${test_suite} FOLDER)
  if (NOT ${test_suite_folder} STREQUAL "NOTFOUND")
    set_property(TARGET ${test_name} PROPERTY FOLDER "${test_suite_folder}")
  endif ()

```

In my generated visual studio project, I see a folder test\_suite\_folder-NOTFOUND at the root. My gut tells me that get\_target\_property returns this when it fails, but the documentation (which surely the original author was writing against) for get\_target\_property states:

> Non-inherited properties will set `VAR` to `NOTFOUND`

I know basically nothing about how the CMake internals work, but I found the following at line 90 of Source/cmGetTargetPropertyCommand.cxx:

```auto
mf.AddDefinition(var, var + "-NOTFOUND");

```

… which leads me to believe that the docs are incorrect. My question is: is this a documentation bug, or am I overlooking something?

---

<div class="post-metadata">

**Author:** ![hex](https://discourse.cmake.org/user_avatar/discourse.cmake.org/hex/32/363_2.png) [@hex](https://discourse.cmake.org/u/hex)\
**Post date:** [June 12, 2020, 10:46pm UTC](https://discourse.cmake.org/t/question-about-failure-result-of-get-target-property/1384/2 "2020-06-12T22:46:52Z")

</div>

it does not set `NOTFOUND`, it appends `-NOTFOUND` to the variable name.

---

<div class="post-metadata">

**Author:** ![christetreault](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/c/f475e1/32.png) [@christetreault](https://discourse.cmake.org/u/christetreault)\
**Post date:** [July 10, 2020, 4:23pm UTC](https://discourse.cmake.org/t/question-about-failure-result-of-get-target-property/1384/3 "2020-07-10T16:23:50Z")

</div>

Thanks for the confirmation. I went ahead and submitted a doc fix, which was approved and merged.
