title: CMake- Difficulties building static library
body: <p>So I have been trying to build libarchive for a couple of days now, following this guide and many other threads: <a href="https://github.com/libarchive/libarchive/wiki/BuildInstructions" rel="nofollow">https://github.com/libarchive/libarchive/wiki/BuildInstructions</a></p>
  
  <p>I want a static library with LZMA, zlib and bzip2 support. I got static versions of these too (lib's)</p>
  
  <p>I just cant get it to work properly. Ive used CMAKE to generate the make files for VS2010 and NMAKE. With both of these options the thing compiles just fine, but when i try to use the archive_static.lib generated, in my project I get plenty of unresolved externals. Compiling the .dll version of the library works without unresolved externals, but then it starts asking for zlib.dll, bzip2.dll etc, which i dont have and dont want to use.</p>
  
  <p>I think i need to set some flags with cmake, but im not sure how to do that.</p>
  
  <p>Any help is greatly appreciated.
   <a href="http://www.libarchive.org/" rel="nofollow">http://www.libarchive.org/</a></p>