Warning, /education/labplot/cmake/FindCFitsio.cmake is written in an unsupported language. File is not indexed.

0001 # - Try to find CFITSIO
0002 # Once done this will define
0003 #
0004 #  CFITSIO_FOUND - system has CFITSIO
0005 #  CFITSIO_INCLUDE_DIR - the CFITSIO include directory
0006 #  CFITSIO_LIBRARIES - Link these to use CFITSIO
0007 
0008 # Copyright (c) 2006, Jasem Mutlaq <mutlaqja@ikarustech.com>
0009 # Based on FindLibfacile by Carsten Niehaus, <cniehaus@gmx.de>
0010 #
0011 # Redistribution and use in source and binary forms, with or without
0012 # modification, are permitted provided that the following conditions
0013 # are met:
0014 #
0015 # 1. Redistributions of source code must retain the copyright
0016 #    notice, this list of conditions and the following disclaimer.
0017 # 2. Redistributions in binary form must reproduce the copyright
0018 #    notice, this list of conditions and the following disclaimer in the
0019 #    documentation and/or other materials provided with the distribution.
0020 # 3. The name of the author may not be used to endorse or promote products
0021 #    derived from this software without specific prior written permission.
0022 #
0023 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
0024 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
0025 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
0026 # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
0027 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
0028 # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
0029 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
0030 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0031 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
0032 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0033 
0034 if (CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES)
0035 
0036     # in cache already
0037     set(CFITSIO_FOUND TRUE)
0038     message(STATUS "Found CFITSIO: ${CFITSIO_LIBRARIES}")
0039 
0040 
0041 else (CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES)
0042 
0043     if (NOT WIN32)
0044         find_package(PkgConfig)
0045         if (PKG_CONFIG_FOUND)
0046             pkg_check_modules(PC_CFITSIO cfitsio)
0047         endif (PKG_CONFIG_FOUND)
0048     endif (NOT WIN32)
0049 
0050     find_path(CFITSIO_INCLUDE_DIR fitsio.h
0051             ${PC_CFITSIO_INCLUDE_DIRS}
0052             ${_obIncDir}
0053             ${GNUWIN32_DIR}/include
0054             )
0055 
0056     find_library(CFITSIO_LIBRARIES NAMES cfitsio libcfitsio
0057             PATHS
0058             ${PC_CFITSIO_LIBRARY_DIRS}
0059             ${_obIncDir}
0060             ${GNUWIN32_DIR}/include
0061             )
0062 
0063     if(CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES)
0064         set(CFITSIO_FOUND TRUE)
0065     else (CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES)
0066         set(CFITSIO_FOUND FALSE)
0067     endif(CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES)
0068 
0069     if (CFITSIO_FOUND)
0070         if (NOT CFitsio_FIND_QUIETLY)
0071             message(STATUS "Found CFITSIO: ${CFITSIO_LIBRARIES}")
0072         endif (NOT CFitsio_FIND_QUIETLY)
0073     else (CFITSIO_FOUND)
0074         if (CFitsio_FIND_REQUIRED)
0075             message(FATAL_ERROR "CFITSIO not found. Please install libcfitsio-dev and try again.")
0076         endif (CFitsio_FIND_REQUIRED)
0077     endif (CFITSIO_FOUND)
0078 
0079     mark_as_advanced(CFITSIO_INCLUDE_DIR CFITSIO_LIBRARIES)
0080 
0081 endif (CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES)