1 cmake_minimum_required(VERSION 2.8.8)
4 set(PROJECT_VERSION "1.5")
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)
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")
17 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
18 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
20 option(BUILD_SHARED_LIBS "Enable shared libraries" ON)
22 option(TNG_BUILD_FORTRAN "Build Fortran compatible library and examples for testing" OFF)
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)
28 find_package(ZLIB QUIET)
29 option(TNG_BUILD_WITH_ZLIB "Build TNG with zlib compression" ${ZLIB_FOUND})
31 include(CheckIncludeFile)
32 check_include_file(inttypes.h HAVE_INTTYPES_H)
36 install(FILES include/tng_io.h include/tng_io_fwd.h DESTINATION include/)
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)
42 if (NOT DOXYGEN_FOUND)
44 "Doxygen is needed to build the documentation. Please install it correctly")
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.
56 install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Documentation/
57 DESTINATION share/tng/doc)