Fix zlib usage with TNG
authorMark Abraham <mark.j.abraham@gmail.com>
Mon, 4 Aug 2014 22:42:26 +0000 (22:42 +0000)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Fri, 22 Aug 2014 10:10:19 +0000 (12:10 +0200)
Using zlib for TNG requires also that the the #include file can be
found, and this can be in a non-standard path. One part of this commit
should be rolled back into the TNG repo.

Change-Id: Iaa70ddd4f5471e405404148e6e83067d5ea52a27

src/external/tng_io/CMakeLists.txt
src/gromacs/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})
index 25da7de0e4f27c8e133c5e047ebe2ed595db41f1..c765548ae1e9bc708815fe9f6c77a3059c87adb3 100644 (file)
@@ -71,6 +71,7 @@ if(GMX_USE_TNG)
 
         if (HAVE_ZLIB)
             list(APPEND GMX_EXTRA_LIBRARIES ${ZLIB_LIBRARIES})
+            include_directories(${ZLIB_INCLUDE_DIRS})
         endif()
     endif()
 else()