Fix linking with static libxml2
[alexxy/gromacs.git] / cmake / gmxTestLibXml2.cmake
index 48e1c21d661875fc1190684154ac2482d04287a4..7e5387c0c9b09e681f6fce9b8a59d739717e0098 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2014, by the GROMACS development team, led by
+# Copyright (c) 2014,2015, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -50,6 +50,9 @@ function(GMX_TEST_LIBXML2 VARIABLE)
         if(_do_libxml2_recompile)
             unset(LIBXML2_LINKS_OK CACHE)
         endif()
+        if(HAVE_ZLIB)
+            set(LIBXML2_LIBRARIES "${LIBXML2_LIBRARIES}" z PARENT_SCOPE) #not needed for dynamic but does not hurt
+        endif()
         check_library_exists("${LIBXML2_LIBRARIES}" "xmlTextWriterEndAttribute" "" LIBXML2_LINKS_OK)
         if(LIBXML2_LINKS_OK)
             #check that xml headers can be included