fix cfitsio variables

This commit is contained in:
Faruk D 2018-08-29 17:04:44 +02:00
parent dbb345da0e
commit 6b9a037e45
6 changed files with 20 additions and 20 deletions

View File

@ -73,7 +73,7 @@ include_directories(${CASACORE_INCLUDE_DIR})
#cfitsio
find_package(CfitsIO REQUIRED)
include_directories(${CFITSIO_INCLUDE_DIR})
include_directories(${CFITSIO_INCLUDE})
#lapack
find_package(LAPACK REQUIRED)
@ -158,8 +158,8 @@ message (STATUS "LAPACK_LIBRARIES........... = ${LAPACK_LIBRARIES}")
#message (STATUS "GFORTRAN-INC ......... = ${GFORTRAN_INCLUDE_DIR}")
#message (STATUS "GFORTRAN-LIBS ......... = ${LIBGFORTRAN_LIBRARIES}")
message (STATUS "CFITSIO_INCLUDE_DIR.......... = ${CFITSIO_INCLUDE_DIR}")
message (STATUS "CFITSIO_LIBRARIES.......... = ${CFITSIO_LIBRARIES}")
message (STATUS "CFITSIO_INCLUDE.......... = ${CFITSIO_INCLUDE}")
message (STATUS "CFITSIO_LIB.......... = ${CFITSIO_LIB}")
message (STATUS "WCSLIB_INCLUDE_DIR........... = ${WCSLIB_INCLUDE_DIR}")
message (STATUS "WCSLIB_LIBRARIES ........... = ${WCSLIB_LIBRARIES}")

View File

@ -3,11 +3,11 @@
# CFITSIO_ROOT_DIR - CFITSIO root directory
# Variables defined by this module:
# CFITSIO_FOUND - system has CFITSIO
# CFITSIO_INCLUDE_DIR - the CFITSIO include directory (cached)
# CFITSIO_INCLUDE_DIRS - the CFITSIO include directories
# (identical to CFITSIO_INCLUDE_DIR)
# CFITSIO_INCLUDE - the CFITSIO include directory (cached)
# CFITSIO_INCLUDES - the CFITSIO include directories
# (identical to CFITSIO_INCLUDE)
# CFITSIO_LIBRARY - the CFITSIO library (cached)
# CFITSIO_LIBRARIES - the CFITSIO libraries
# CFITSIO_LIB - the CFITSIO libraries
# (identical to CFITSIO_LIBRARY)
# CFITSIO_VERSION_STRING the found version of CFITSIO, padded to 3 digits
@ -33,12 +33,12 @@
if(NOT CFITSIO_FOUND)
find_path(CFITSIO_INCLUDE_DIR fitsio.h
find_path(CFITSIO_INCLUDE fitsio.h
HINTS ${CFITSIO_ROOT_DIR} PATH_SUFFIXES include include/cfitsio
include/libcfitsio0)
if(CFITSIO_INCLUDE_DIR)
FILE(READ "${CFITSIO_INCLUDE_DIR}/fitsio.h" CFITSIO_H)
if(CFITSIO_INCLUDE)
FILE(READ "${CFITSIO_INCLUDE}/fitsio.h" CFITSIO_H)
set(CFITSIO_VERSION_REGEX ".*#define CFITSIO_VERSION[^0-9]*([0-9]+)\\.([0-9]+).*")
if ("${CFITSIO_H}" MATCHES ${CFITSIO_VERSION_REGEX})
# Pad CFITSIO minor version to three digit because 3.181 is older than 3.35
@ -51,24 +51,24 @@ if(NOT CFITSIO_FOUND)
else ()
set(CFITSIO_VERSION_STRING "Unknown")
endif()
endif(CFITSIO_INCLUDE_DIR)
endif(CFITSIO_INCLUDE)
find_library(CFITSIO_LIBRARY cfitsio
HINTS ${CFITSIO_ROOT_DIR} PATH_SUFFIXES lib)
find_library(M_LIBRARY m)
mark_as_advanced(CFITSIO_INCLUDE_DIR CFITSIO_LIBRARY M_LIBRARY)
mark_as_advanced(CFITSIO_INCLUDE CFITSIO_LIBRARY M_LIBRARY)
if(CMAKE_VERSION VERSION_LESS "2.8.3")
find_package_handle_standard_args(CFITSIO DEFAULT_MSG
CFITSIO_LIBRARY M_LIBRARY CFITSIO_INCLUDE_DIR)
CFITSIO_LIBRARY M_LIBRARY CFITSIO_INCLUDE)
else ()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(CFITSIO
REQUIRED_VARS CFITSIO_LIBRARY M_LIBRARY CFITSIO_INCLUDE_DIR
REQUIRED_VARS CFITSIO_LIBRARY M_LIBRARY CFITSIO_INCLUDE
VERSION_VAR CFITSIO_VERSION_STRING)
endif ()
set(CFITSIO_INCLUDE_DIRS ${CFITSIO_INCLUDE_DIR})
set(CFITSIO_LIBRARIES ${CFITSIO_LIBRARY} ${M_LIBRARY})
set(CFITSIO_INCLUDES ${CFITSIO_INCLUDE})
set(CFITSIO_LIB ${CFITSIO_LIBRARY} ${M_LIBRARY})
endif(NOT CFITSIO_FOUND)

View File

@ -18,7 +18,7 @@ add_executable(sagecal-mpi ${SRCFILES})
target_link_libraries(sagecal-mpi
${CASACORE_LIBRARIES}
${CFITSIO_LIBRARIES}
${CFITSIO_LIB}
${OpenBLAS_LIB}
${LAPACK_LIBRARIES}
${WCSLIB_LIBRARIES}

View File

@ -23,7 +23,7 @@ add_executable(sagecal ${SRCFILES})
target_link_libraries(sagecal
${CASACORE_LIBRARIES}
${CFITSIO_LIBRARIES}
${CFITSIO_LIB}
${OpenBLAS_LIB}
${LAPACK_LIBRARIES}
${WCSLIB_LIBRARIES}

View File

@ -8,7 +8,7 @@ FILE(GLOB SRCFILES *.c)
add_executable(buildsky ${SRCFILES})
target_link_libraries(buildsky
${CFITSIO_LIBRARIES}
${CFITSIO_LIB}
${OpenBLAS_LIB}
${LAPACK_LIBRARIES}
${WCSLIB_LIBRARIES}

View File

@ -9,7 +9,7 @@ FILE(GLOB SRCFILES *.c)
add_executable(restore ${SRCFILES})
target_link_libraries(restore
${CFITSIO_LIBRARIES}
${CFITSIO_LIB}
${OpenBLAS_LIB}
${LAPACK_LIBRARIES}
${WCSLIB_LIBRARIES}