CMake Wildcard for TARGET_OBJECTS
<p>I have the following directory structure </p>

<pre><code>-  CMakeLists.txt
-  include
    -  a.hh
-  lib
    -  CMakeLists.txt
    -  a.cc
-  src
    -  CMakeLists.txt
    -  main.cc
-  test
    -  CMakeLists.txt
    -  test.cc
</code></pre>

<p>I am using CMake for compiling test.cc using the command </p>

<pre><code>add_executable(test test.cc $&lt;TARGET_OBJECTS:A&gt;)
</code></pre>

<p>and the object file <code>A.o</code> is compiled as </p>

<pre><code>add_library(A OBJECT A.cc)
</code></pre>

<p>but the <code>$&lt;TARGET_OBJECTS:A&gt;</code> command becomes ugly very quickly. Is there any way to tell CMake to include all <code>.o</code> files in the lib folder for linking everything? </p>