Use parallel terminology more consistently
[alexxy/gromacs.git] / src / external / tng_io / src / lib / CMakeLists.txt
1 set(source_files tng_io.c md5.c)
2 if(TNG_BUILD_FORTRAN)
3   list(APPEND source_files tng_io_fortran.c)
4 endif()
5
6 add_library(tng_io ${source_files})
7
8 # Now add source-file compilation properties to the source-file
9 # targets
10
11 if(HAVE_INTTYPES_H)
12   set_property(SOURCE tng_io.c APPEND PROPERTY COMPILE_DEFINITIONS USE_STD_INTTYPES_H)
13 endif()
14 if(TNG_BUILD_WITH_ZLIB)
15   set_property(SOURCE tng_io.c APPEND PROPERTY COMPILE_DEFINITIONS USE_ZLIB)
16 endif()
17
18 # This test is for md5. The TNG library itself determines the actual byte order -
19 # not just if it is small or big endian.
20 include(TestBigEndian)
21 test_big_endian(TNG_INTEGER_BIG_ENDIAN)
22 if(TNG_INTEGER_BIG_ENDIAN)
23   set_property(SOURCE md5.c APPEND PROPERTY COMPILE_DEFINITIONS TNG_INTEGER_BIG_ENDIAN)
24 endif()
25
26 # Append the required library dependencies
27 target_link_libraries(tng_io tng_compress)
28 if(TNG_BUILD_WITH_ZLIB)
29   target_link_libraries(tng_io ${ZLIB_LIBRARIES})
30 endif()
31
32 # Use GNUInstallDirst to set paths on multiarch systems
33 include(GNUInstallDirs)
34
35 install(TARGETS tng_io
36         LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
37         ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})