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 # SPDX-FileCopyrightText: 2006 Jasem Mutlaq <mutlaqja@ikarustech.com>
0009 # Based on FindLibfacile by Carsten Niehaus, <cniehaus@gmx.de>
0010 #
0011 # SPDX-License-Identifier: BSD-3-Clause
0012 
0013 if (CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES)
0014 
0015     # in cache already
0016     set(CFITSIO_FOUND TRUE)
0017     message(STATUS "Found CFITSIO: ${CFITSIO_LIBRARIES}")
0018 
0019 
0020 else (CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES)
0021 
0022     if (NOT WIN32)
0023             find_package(PkgConfig QUIET)
0024         if (PKG_CONFIG_FOUND)
0025                 pkg_check_modules(PC_CFITSIO cfitsio QUIET)
0026         endif (PKG_CONFIG_FOUND)
0027     endif (NOT WIN32)
0028 
0029     find_path(CFITSIO_INCLUDE_DIR fitsio.h
0030             ${PC_CFITSIO_INCLUDE_DIRS}
0031             ${_obIncDir}
0032             ${GNUWIN32_DIR}/include
0033             )
0034 
0035     find_library(CFITSIO_LIBRARIES NAMES cfitsio libcfitsio QUIET
0036             PATHS
0037             ${PC_CFITSIO_LIBRARY_DIRS}
0038             ${_obIncDir}
0039             ${GNUWIN32_DIR}/include
0040             )
0041 
0042     if(CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES)
0043         set(CFITSIO_FOUND TRUE)
0044     else (CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES)
0045         set(CFITSIO_FOUND FALSE)
0046     endif(CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES)
0047 
0048     if (CFITSIO_FOUND)
0049         if (NOT CFitsio_FIND_QUIETLY)
0050                 message(STATUS "Found CFITSIO: ${CFITSIO_LIBRARIES} (found version \"${PC_CFITSIO_VERSION}\")")
0051         endif (NOT CFitsio_FIND_QUIETLY)
0052     else ()
0053         if (CFitsio_FIND_REQUIRED)
0054             message(FATAL_ERROR "CFITSIO not found. Please install libcfitsio-dev or cfitsio-devel and try again.")
0055         endif (CFitsio_FIND_REQUIRED)
0056         set(CFITSIO_LIBRARIES "")
0057     endif ()
0058 
0059     mark_as_advanced(CFITSIO_INCLUDE_DIR CFITSIO_LIBRARIES)
0060 
0061 endif (CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES)