title: Build dependency in CMake
body: <p>I want to build and use Botan linked statically in my application, which means first</p>
  
  <pre><code>python configure.py --disable shared
  </code></pre>
  
  <p>followed by</p>
  
  <pre><code>make
  </code></pre>
  
  <p>And then I'd like to create a dependency target for libbotan.a as "libbotan" that I can use in the rest of my CMake files. Since Botan not using CMake I'm not sure how to include the dependency in my project.</p>
  
  <p>My current attempt looks like this:</p>
  
  <p>in deps/Botan.1.11.7/CmakeLists.txt</p>
  
  <pre><code>add_custom_command(OUTPUT botan-configure COMMAND ./configure.py --disable-shared)
  add_custom_command(OUTPUT botan-build COMMAND make DEPENDS botan-configure)
  add_custom_target(botan DEPENDS botan-configure botan-build)
  </code></pre>
  
  <p>but when I added botan as a dependency in core/CMakeLists.txt like this</p>
  
  <pre><code>add_executable(console console.cpp)
  target_link_libraries(console messages core botan ${Boost_LIBRARIES})
  </code></pre>
  
  <p>I get </p>
  
  <pre><code>CMake Error at simpleclient/CMakeLists.txt:5 (target_link_libraries):
   Target "botan" of type UTILITY may not be linked into another target.  One
   may link only to STATIC or SHARED libraries, or to executables with the
   ENABLE_EXPORTS property set.
  </code></pre>
  
  <p>I tried using ExternalProject_Add like this</p>
  
  <pre><code>ExternalProject_Add(botan
      GIT_REPOSITORY https://github.com/randombit/botan.git
      CONFIGURE_COMMAND python configure.py --disable-shared
      BUILD_COMMAND make
      INSTALL_COMMAND make install
  )
  </code></pre>
  
  <p>But that gives me the same error.</p>