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