Warning, /graphics/kst-plot/cmake/modules/FindMatio.cmake is written in an unsupported language. File is not indexed.

0001 # ***************************************************************************
0002 # *                                                                         *
0003 # *   Copyright : (C) 2010 The University of Toronto                        *
0004 # *   email     : netterfield@astro.utoronto.ca                             *
0005 # *                                                                         *
0006 # *   Copyright : (C) 2010 Peter Kümmel                                     *
0007 # *   email     : syntheticpp@gmx.net                                       *
0008 # *                                                                         *
0009 # *   This program is free software; you can redistribute it and/or modify  *
0010 # *   it under the terms of the GNU General Public License as published by  *
0011 # *   the Free Software Foundation; either version 2 of the License, or     *
0012 # *   (at your option) any later version.                                   *
0013 # *                                                                         *
0014 # ***************************************************************************
0015 
0016 # copied from FindGsl.cmake
0017 
0018 if(NOT MATIO_INCLUDEDIR)
0019 
0020 if(NOT kst_cross)
0021         include(FindPkgConfig)
0022         pkg_check_modules(PKGMATIO QUIET matio)
0023 endif()
0024 
0025 if(NOT PKGMATIO_LIBRARIES)
0026         set(PKGMATIO_LIBRARIES matio)
0027         if (UNIX)
0028                 set(PKGMATIO_LIBRARIES ${PKGMATIO_LIBRARIES})
0029         endif()
0030 endif()
0031 
0032 set(MATIO_INCLUDEDIR MATIO_INCLUDEDIR-NOTFOUND CACHE STRING "" FORCE)
0033 find_path(MATIO_INCLUDEDIR matio.h
0034         HINTS
0035         ENV MATIO_DIR
0036         PATH_SUFFIXES include
0037         PATHS ${kst_3rdparty_dir} ${PKGMATIO_INCLUDEDIR})
0038 
0039 set(MATIO_LIBRARY_LIST)
0040 if(kst_3rdparty_dir)
0041     list(APPEND PKGMATIO_LIBRARIES zlibstatic)
0042 endif()
0043 foreach(it ${PKGMATIO_LIBRARIES})
0044         set(lib lib-NOTFOUND CACHE STRING "" FORCE)
0045         FIND_LIBRARY(lib ${it} 
0046                 HINTS
0047                 ENV MATIO_DIR
0048                 PATH_SUFFIXES lib
0049                 PATHS ${kst_3rdparty_dir} ${PKGMATIO_LIBRARY_DIRS})
0050         list(APPEND MATIO_LIBRARY_LIST ${lib})
0051 endforeach()
0052 set(MATIO_LIBRARIES ${MATIO_LIBRARY_LIST} CACHE STRING "" FORCE)
0053 
0054 endif()
0055 
0056 
0057 if(MATIO_INCLUDEDIR AND MATIO_LIBRARIES)
0058         set(MATIO_INCLUDE_DIR ${MATIO_INCLUDEDIR} ${MATIO_INCLUDEDIR}/..)
0059         set(matio 1)
0060         message(STATUS "Found matio (for Matlab .mat support):")
0061         message(STATUS "     includes : ${MATIO_INCLUDE_DIR}")
0062         message(STATUS "     libraries: ${MATIO_LIBRARIES}")
0063 else()
0064         message(STATUS "Not found: matio, set MATIO_DIR")
0065 endif()
0066 
0067 message(STATUS "")
0068