title: How to find static version of zlib in CMake?
body: <p>I'm on cmake version 3.12.1 and want to build a static executable that uses ZLIB. I have both the static (libz.a) and shared (libz.so) libraries on my machine. How can I tell <code>find_package(ZLIB)</code> to return the static version? Maybe there's another way to find <code>libz.a</code> as well?</p>
  
  <p>My present workaround is to specify:</p>
  
  <p><code>SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")</code></p>
  
  <p>Then:</p>
  
  <p><code>target_link_libraries (my_binary z lib1 lib2)</code></p>
  
  <p>Critique on this approach is also welcome!</p>