# Error evaluating generator expression --- but exit states == 0 ?

**URL:** https://discourse.cmake.org/t/error-evaluating-generator-expression-but-exit-states-0/15876
**Category:** Development
**Created:** [October 15, 2026, 9:17pm UTC](https://discourse.cmake.org/t/error-evaluating-generator-expression-but-exit-states-0/15876 "2026-10-15T21:17:08Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![johan556](https://discourse.cmake.org/user_avatar/discourse.cmake.org/johan556/32/788_2.png) [@johan556](https://discourse.cmake.org/u/johan556)
#### Post date: [October 15, 2026, 9:17pm UTC](https://discourse.cmake.org/t/error-evaluating-generator-expression-but-exit-states-0/15876/1 "2026-10-15T21:17:08Z")

</div>

I tried the 4.5.0-rc1 version and got what seemed like an error (se below). But the cmake invocation went ok (exit == 0), and I could build my project.

Shouldn’t this be reported in some other way, not saying that it is an error?

```auto
CMake Error:                                                                                                                                                                                        
  Error evaluating generator expression:                                                                                                                                                            
                                                                                                                                                                                                    
    $<TARGET_PROPERTY:Cups::Cups,INTERFACE_INCLUDE_DIRECTORIES>                                   
                                                                                                  
  Target "Cups::Cups" not found.

```

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [October 16, 2026, 2:35pm UTC](https://discourse.cmake.org/t/error-evaluating-generator-expression-but-exit-states-0/15876/2 "2026-10-16T14:35:06Z")

</div>

I’m not able to reproduce the problem with a simple project like:

```cmake
cmake_minimum_required(VERSION 4.4)
project(Discourse15876 C)
add_executable(main main.c)
target_include_directories(main PRIVATE "$<TARGET_PROPERTY:Cups::Cups,INTERFACE_INCLUDE_DIRECTORIES>")

```

Please post a more complete example demonstrating the problem.
