title: CMAKE: Include files not found with OBJECT
body: <p>I have now a working CMake project which use Qt5 includes.
  Several parts of the project are compiled using</p>
  
  <p><code>add_library(myLib STATIC ${lib_src})</code></p>
  
  <p>I'm trying to make use of the OBJECT now, so I changed to</p>
  
  <p><code>add_library(myLib OBJECT ${lib_src})</code></p>
  
  <p>but, when compiling, I get the following error:</p>
  
  <blockquote>
    <p>QObject, no such file or directory &lt;- is not able to find qt includes</p>
  </blockquote>
  
  <p>Can somebody tell me how can I fix my project to use OBJECT?</p>
  
  <p>P.S. extra details:
  the project is hosted <a href="http://quickgit.kde.org/?p=digikam.git&amp;a=tree&amp;hb=a5395215a74a8b36f3bb6b8ab8ab66e38c5782ab" rel="nofollow">here</a>:
  the main CMake which make the executable is in the <a href="http://quickgit.kde.org/?p=digikam.git&amp;a=blob&amp;h=f9d1b9d5c9fb7e3690351e9f426b9d25cb2a7c4d&amp;hb=a5395215a74a8b36f3bb6b8ab8ab66e38c5782ab&amp;f=app%2FCMakeLists.txt" rel="nofollow">app folder</a>.</p>
  
  <p><em>baloowrap</em> lib is linked here in <em>digikamgui</em>, then <em>digikamgui</em> is linked into <em>digikam</em> executable and the <code>OBJECT</code> that I want to create is in <code>utilities/baloo</code> which contains the following:</p>
  
  <pre><code>set(baloowrap_SRCS baloowrap.cpp)
  add_library(baloowrap STATIC ${baloowrap_SRCS})
  target_link_libraries(baloowrap KF5::FileMetaData KF5::I18n)
  </code></pre>