From 71a0a9d637571b39264a4add8462772b2ed5baba Mon Sep 17 00:00:00 2001 From: Mark Abraham Date: Mon, 4 Aug 2014 22:42:26 +0000 Subject: [PATCH] Fix zlib usage with TNG 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 | 5 +++-- src/gromacs/CMakeLists.txt | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/external/tng_io/CMakeLists.txt b/src/external/tng_io/CMakeLists.txt index 7fc6ad6503..594069660e 100644 --- a/src/external/tng_io/CMakeLists.txt +++ b/src/external/tng_io/CMakeLists.txt @@ -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}) diff --git a/src/gromacs/CMakeLists.txt b/src/gromacs/CMakeLists.txt index 25da7de0e4..c765548ae1 100644 --- a/src/gromacs/CMakeLists.txt +++ b/src/gromacs/CMakeLists.txt @@ -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() -- 2.22.0