Bumped the TNG library to the latest version.
[alexxy/gromacs.git] / src / external / tng_io / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.8)
2
3 project(TNG_IO)
4 set(PROJECT_VERSION "1.5")
5 set(API_VERSION "5")
6
7 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/version.h.in
8                 ${CMAKE_BINARY_DIR}/include/version.h )
9 include_directories(${CMAKE_BINARY_DIR}/include)
10
11 if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
12     set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall")
13 elseif(WIN32 AND NOT CYGWIN)
14     set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /W2")
15 endif()
16
17 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
18 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
19
20 option(BUILD_SHARED_LIBS "Enable shared libraries" ON)
21
22 option(TNG_BUILD_FORTRAN "Build Fortran compatible library and examples for testing" OFF)
23
24 option(TNG_BUILD_EXAMPLES "Build examples showing usage of the TNG API" ON)
25 option(TNG_BUILD_TEST "Build TNG testing binary." ON)
26 option(TNG_BUILD_COMPRESSION_TESTS "Build tests of the TNG compression library" OFF)
27
28 find_package(ZLIB QUIET)
29 option(TNG_BUILD_WITH_ZLIB "Build TNG with zlib compression" ${ZLIB_FOUND})
30
31 include(CheckIncludeFile)
32 check_include_file(inttypes.h   HAVE_INTTYPES_H)
33
34 add_subdirectory(src)
35
36 install(FILES include/tng_io.h DESTINATION include/)
37
38 #-- Add an Option to toggle the generation of the API documentation
39 option(TNG_BUILD_DOCUMENTATION "Use Doxygen to create the HTML based API documentation" OFF)
40 if(TNG_BUILD_DOCUMENTATION)
41   find_package(Doxygen)
42   if (NOT DOXYGEN_FOUND)
43     message(FATAL_ERROR
44       "Doxygen is needed to build the documentation. Please install it correctly")
45   endif()
46   #-- Configure the Template Doxyfile for our specific project
47   configure_file(Doxyfile.in
48                  ${PROJECT_BINARY_DIR}/Doxyfile  @ONLY IMMEDIATE)
49   #-- Add a custom target to run Doxygen when ever the project is built
50   add_custom_target (Docs ALL
51                                         COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/Doxyfile
52                                         SOURCES ${PROJECT_BINARY_DIR}/Doxyfile)
53   # IF you do NOT want the documentation to be generated EVERY time you build the project
54   # then leave out the 'ALL' keyword from the above command.
55
56   install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Documentation/
57       DESTINATION share/tng/doc)
58 endif()
59