Fix zlib usage with TNG
[alexxy/gromacs.git] / src / external / tng_io / CMakeLists.txt
index 7fc6ad65034b48528ac27a83a934b7ac18d4dfce..594069660edc51188b7dc0ed5ba8356ab9191541 100644 (file)
@@ -31,16 +31,17 @@ tng_get_source_list(TNG_SOURCES TNG_COMPILE_DEFS)
 
 tng_set_source_properties(WITH_ZLIB ${ZLIB_FOUND})
 
+add_library(tng_io ${TNG_SOURCES})
+
 if (ZLIB_FOUND)
   list(APPEND EXTRA_LIBRARIES ${ZLIB_LIBRARIES})
+  include_directories(${ZLIB_INCLUDE_DIRS})
 endif()
 
 if (UNIX)
   list(APPEND EXTRA_LIBRARIES m)
 endif()
 
-add_library(tng_io ${TNG_SOURCES})
-
 target_link_libraries(tng_io ${EXTRA_LIBRARIES})
 
 set_target_properties(tng_io PROPERTIES VERSION ${TNG_IO_VERSION} SOVERSION ${TNG_MAJOR_VERSION})