title: CMake ADD_LIBRARY INTERFACE alternative
body: <p>I am trying to use a header only library (<a href="http://threadpool.sourceforge.net/" rel="nofollow">thread-pool</a>) as a sub project. So in root <code>CMakeLists.txt</code> I have</p>
  
  <pre><code>ADD_SUBDIRECTORY(thread_pool)
  </code></pre>
  
  <p>inside <code>thread-pool/CMakeLists.txt</code></p>
  
  <pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
  PROJECT(thread-pool)
  
  SET(THREAD_POOL_SOURCES)
  
  ADD_LIBRARY(thread-pool STATIC ${THREAD_POOL_SOURCES})
  </code></pre>
  
  <p>As this is a header only library with no source, it gives error.</p>
  
  <blockquote>
    <p>CMake Error: CMake can not determine linker language for target:
    thread-pool</p>
  </blockquote>
  
  <p>One solution is to use <code>ADD_LIBRARY(thread-pool INTERFACE)</code> but that only works with CMake <code>3.0</code> and I've 2.8 installed. I am not asking for a solution on how to upgrade CMake to 3.0 but is there any <code>alternative way that I can use with CMake 2.6 or 2.8</code> ?</p>
  
  <p>One way that comes in my mind is to have a fake cpp file with some dummy function and put that in sources, But that will be a bad solution.</p>