title: calling get_target_property() on target that is defined later
body: <p>I have a problem with CMake <code>get_target_property</code>. It runs on a library that is defined later and returns an error. This is my code:</p>
  
  <pre><code>add_library(UT_pal_logger OBJECT ${SOURCES})
  target_add_interfaces(UT_pal_logger cppunit_addon)
  </code></pre>
  
  <p>In other files there is:</p>
  
  <pre><code>function(target_add_interfaces TARGET OTHER_TARGETS)
     foreach(OTHER_TARGET ${OTHER_TARGETS})
        get_target_property(TMP_INCLUDES ${OTHER_TARGET} INTERFACE_INCLUDE_DIRECTORIES)
        if(TMP_INCLUDES)
           target_include_directories(${TARGET} PUBLIC ${TMP_INCLUDES})
        endif()
     endforeach(OTHER_TARGET)
  endfunction()
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>add_library(cppunit_addon STATIC ${SOURCES})
  target_include_directories(cppunit_addon PUBLIC Include)
  </code></pre>
  
  <p>Note that <code>cppunit_addon</code> brings some headers that are used in <code>UT_pal_logger</code>.</p>
  
  <p>This fails with the message:</p>
  
  <pre><code>CMake Error at Scripts/CMake/target_add_interfaces.cmake:22 (get_target_property):
    get_target_property() called with non-existent target "cppunit_addon".
  Call Stack (most recent call first):
    .../logger/CMakeLists.txt:36 (target_add_interfaces)
  </code></pre>
  
  <p>However this configures and builds just fine:</p>
  
  <pre><code>add_library(UT_pal_logger STATIC ${SOURCES})
  target_link_libraries(UT_pal_logger cppunit_addon)
  </code></pre>
  
  <p>---> <code>target_link_libraries</code> somehow wait until everything is parsed and <code>get_target_property</code> does not. This is also <a href="https://cmake.org/cmake/help/v3.6/command/get_target_property.html" rel="nofollow noreferrer">documented</a>:</p>
  
  <blockquote>
    <p>This command can get properties for any target <strong>so far</strong> created. </p>
  </blockquote>
  
  <p>I could also change the order of <code>add_directory</code> commands to fix this. But this is not a clean solution. How can i make <code>get_target_property</code> wait until everything was parsed?</p>