2017-08-21 19:11:29 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE
|
|
|
|
URLS "https://heasarc.gsfc.nasa.gov/fitsio/ccfits/CCfits-2.5.tar.gz"
|
|
|
|
FILENAME "CCfits-2.5.tar.gz"
|
|
|
|
SHA512 63ab4d153063960510cf60651d5c832824cf85f937f84adc5390c7c2fb46eb8e9f5d8cda2554d79d24c7a4f1b6cf0b7a6e20958fb69920b65d7c362c0a5f26b5
|
|
|
|
)
|
2019-10-08 01:35:13 +08:00
|
|
|
|
2019-08-02 08:54:45 +08:00
|
|
|
vcpkg_extract_source_archive_ex(
|
|
|
|
ARCHIVE ${ARCHIVE}
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
PATCHES dll_exports.patch
|
|
|
|
)
|
2017-08-21 19:11:29 +08:00
|
|
|
|
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2018-03-23 21:53:43 +08:00
|
|
|
PREFER_NINJA
|
|
|
|
OPTIONS
|
|
|
|
-DCFITSIO_INCLUDE_DIR=${CURRENT_INSTALLED_DIR}/include/cfitsio
|
2017-08-21 19:11:29 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
2018-03-23 21:53:43 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
2017-08-21 19:11:29 +08:00
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin)
|
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/CCfits.dll ${CURRENT_PACKAGES_DIR}/bin/CCfits.dll)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/CCfits.dll ${CURRENT_PACKAGES_DIR}/debug/bin/CCfits.dll)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Remove duplicate include files
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
|
2018-03-23 21:53:43 +08:00
|
|
|
# Patch installed headers to look in the correct subdirectory
|
|
|
|
file(GLOB HEADERS ${CURRENT_PACKAGES_DIR}/include/CCfits/*)
|
|
|
|
foreach(HEADER IN LISTS HEADERS)
|
|
|
|
file(READ "${HEADER}" _contents)
|
|
|
|
string(REPLACE "\"fitsio.h\"" "\"cfitsio/fitsio.h\"" _contents "${_contents}")
|
|
|
|
file(WRITE "${HEADER}" "${_contents}")
|
|
|
|
endforeach()
|
|
|
|
|
2017-08-21 19:11:29 +08:00
|
|
|
# Handle copyright
|
2020-05-26 02:52:48 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|