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