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

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?

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

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

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.

If I try to remember the situation:

  • my application uses Qt on Ubuntu 26.04 (not installed as a Debian package, but locally installed from Qt company).
  • I find the line with “$<TARGET_PROPERTY:Cups::Cups,INTERFACE_INCLUDE_DIRECTORIES>” in the file “6.8.9/Src/qtbase/src/printsupport/CMakeLists.txt” and in “6.8.9/gcc_64/lib/cmake/Qt6PrintSupport/Qt6PrintSupportTargets.cmake”
  • when I got the error described earlier, my “solution” was to install the Debian package “libcups2-dev”. I did this just hoping that “Cups” was referring to that package.

If it would be helpful, I might try to reproduce the error again, after uninstalling the “libcups2-dev” package.

When it occurred I assumed that the combination of a “CMake Error” with zero exit status was enough to pinpoint the problem.