Warning, /graphics/kst-plot/cmake/3rdparty/matio/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 cmake_minimum_required(VERSION 2.6)
0002 
0003 project(matio)
0004 
0005 
0006 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY  ${CMAKE_BINARY_DIR}/bin) 
0007 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY  ${CMAKE_BINARY_DIR}/lib) 
0008 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY  ${CMAKE_BINARY_DIR}/lib) 
0009 
0010 if(NOT ZLIB_INCLUDE_DIR OR NOT ZLIB_LIBRARY)
0011     find_package(ZLIB)
0012 endif()
0013 if(ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY)
0014     message(STATUS "Building with zlib support")
0015     set(zlib 1)
0016     add_definitions(-DHAVE_ZLIB=1)
0017     include_directories(${ZLIB_INCLUDE_DIR})
0018 endif()
0019 
0020 if(NOT matio_dir)
0021     set(matio_dir ${CMAKE_SOURCE_DIR})
0022 endif()
0023 
0024 if(MSVC)
0025     configure_file(matioConfig.h.msvc.cmake   ${CMAKE_BINARY_DIR}/matioConfig.h   COPYONLY)
0026     configure_file(matio_pubConf.h.msvc.cmake ${CMAKE_BINARY_DIR}/matio_pubConf.h COPYONLY)
0027     configure_file(inttypes.h ${CMAKE_BINARY_DIR}/inttypes.h COPYONLY)
0028 endif()
0029 if(MINGW)
0030     configure_file(matioConfig.h.mingw.cmake   ${CMAKE_BINARY_DIR}/matioConfig.h   COPYONLY)
0031     configure_file(matio_pubConf.h.mingw.cmake ${CMAKE_BINARY_DIR}/matio_pubConf.h COPYONLY)
0032 endif()
0033 
0034 
0035 set(matio_src
0036     ${matio_dir}/src/snprintf.c
0037     ${matio_dir}/src/endian.c
0038     ${matio_dir}/src/io.c
0039     ${matio_dir}/src/read_data.c
0040     ${matio_dir}/src/mat5.c
0041     ${matio_dir}/src/mat4.c
0042     ${matio_dir}/src/mat.c
0043     ${matio_dir}/src/matvar_cell.c
0044     ${matio_dir}/src/matvar_struct.c)
0045 
0046 if(zlib)
0047     list(APPEND matio_src ${matio_dir}/src/inflate.c)
0048 endif()
0049 
0050 set(matio_h
0051     ${CMAKE_BINARY_DIR}/matioConfig.h
0052     ${CMAKE_BINARY_DIR}/matio_pubconf.h
0053     ${matio_dir}/src/matio.h
0054     ${matio_dir}/src/matio_private.h 
0055     ${matio_dir}/src/mat4.h 
0056     ${matio_dir}/src/mat5.h 
0057     ${matio_dir}/src/mat73.h)
0058 
0059 if(MSVC)
0060     add_definitions(-D_CRT_SECURE_NO_WARNINGS)
0061     set(CMAKE_DEBUG_POSTFIX d)
0062 endif()
0063 
0064 include_directories(${matio_dir}/src ${CMAKE_BINARY_DIR})
0065 
0066 add_library(matio STATIC ${matio_src} ${matio_h})
0067 
0068 if(NOT CMAKE_INSTALL_PREFIX)
0069     set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/installed)
0070 endif()
0071 
0072 install(FILES ${matio_dir}/src/matio.h ${CMAKE_BINARY_DIR}/matio_pubConf.h DESTINATION include)
0073 install(TARGETS matio DESTINATION lib)
0074 
0075