2017-02-24 13:16:23 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2022-01-13 04:13:55 +08:00
|
|
|
URLS "https://www.fftw.org/fftw-3.3.10.tar.gz"
|
2021-09-29 02:53:02 +08:00
|
|
|
FILENAME "fftw-3.3.10.tar.gz"
|
2021-09-29 23:26:29 +08:00
|
|
|
SHA512 2d34b5ccac7b08740dbdacc6ebe451d8a34cf9d9bfec85a5e776e87adf94abfd803c222412d8e10fbaa4ed46f504aa87180396af1b108666cde4314a55610b40
|
2017-02-24 13:16:23 +08:00
|
|
|
)
|
|
|
|
|
2023-04-14 00:13:15 +08:00
|
|
|
vcpkg_extract_source_archive(
|
|
|
|
SOURCE_PATH
|
2023-07-06 03:01:38 +08:00
|
|
|
ARCHIVE "${ARCHIVE}"
|
2019-02-15 06:50:08 +08:00
|
|
|
PATCHES
|
2019-05-22 12:04:01 +08:00
|
|
|
fftw3_arch_fix.patch
|
2020-01-28 03:54:00 +08:00
|
|
|
aligned_malloc.patch
|
2022-07-26 03:19:03 +08:00
|
|
|
bigobj.patch
|
2023-07-06 03:01:38 +08:00
|
|
|
fix-openmp.patch
|
2023-08-10 01:25:30 +08:00
|
|
|
install-subtargets.patch
|
2024-07-10 01:34:48 +08:00
|
|
|
fix-wrong-version.patch # https://github.com/FFTW/fftw3/commit/0842f00ae6b6e1f3aade155bc0edd17a7313fa6a
|
2019-02-15 06:50:08 +08:00
|
|
|
)
|
|
|
|
|
2020-01-28 03:54:00 +08:00
|
|
|
vcpkg_check_features(
|
|
|
|
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
2021-09-08 23:02:56 +08:00
|
|
|
FEATURES
|
2023-08-10 01:25:30 +08:00
|
|
|
openmp ENABLE_OPENMP
|
|
|
|
openmp CMAKE_REQUIRE_FIND_PACKAGE_OpenMP
|
2021-09-08 23:02:56 +08:00
|
|
|
threads ENABLE_THREADS
|
|
|
|
threads WITH_COMBINED_THREADS
|
2023-08-10 01:25:30 +08:00
|
|
|
avx2 ENABLE_AVX2
|
|
|
|
avx ENABLE_AVX
|
|
|
|
sse2 ENABLE_SSE2
|
|
|
|
sse ENABLE_SSE
|
2020-01-28 03:54:00 +08:00
|
|
|
)
|
2019-03-15 06:24:31 +08:00
|
|
|
|
2023-08-10 01:25:30 +08:00
|
|
|
set(package_names fftw3 fftw3f fftw3l)
|
|
|
|
set(fftw3_options "")
|
|
|
|
set(fftw3f_options -DENABLE_FLOAT=ON)
|
|
|
|
set(fftw3l_options -DENABLE_LONG_DOUBLE=ON -DENABLE_AVX2=OFF -DENABLE_AVX=OFF -DENABLE_SSE2=OFF)
|
2019-05-22 12:04:01 +08:00
|
|
|
|
2023-08-10 01:25:30 +08:00
|
|
|
foreach(package_name IN LISTS package_names)
|
|
|
|
message(STATUS "${package_name}...")
|
2023-07-06 03:01:38 +08:00
|
|
|
vcpkg_cmake_configure(
|
2021-09-08 23:02:56 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2023-08-10 01:25:30 +08:00
|
|
|
LOGFILE_BASE "config-${package_name}-${TARGET_TRIPLET}"
|
2019-03-15 06:24:31 +08:00
|
|
|
OPTIONS
|
2020-01-28 03:54:00 +08:00
|
|
|
${FEATURE_OPTIONS}
|
2023-08-10 01:25:30 +08:00
|
|
|
${${package_name}_options} # may override FEATURE_OPTIONS
|
2019-05-22 12:04:01 +08:00
|
|
|
-DBUILD_TESTS=OFF
|
2023-07-06 03:01:38 +08:00
|
|
|
MAYBE_UNUSED_VARIABLES
|
|
|
|
CMAKE_REQUIRE_FIND_PACKAGE_OpenMP
|
|
|
|
)
|
2023-08-10 01:25:30 +08:00
|
|
|
vcpkg_cmake_build(
|
|
|
|
LOGFILE_BASE "install-${package_name}"
|
|
|
|
TARGET install
|
|
|
|
)
|
2019-05-22 12:04:01 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2019-03-15 06:24:31 +08:00
|
|
|
|
2023-08-10 01:25:30 +08:00
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME "${package_name}" CONFIG_PATH "lib/cmake/${package_name}")
|
2019-05-22 12:04:01 +08:00
|
|
|
endforeach()
|
2023-08-10 01:25:30 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2019-03-15 06:24:31 +08:00
|
|
|
|
2021-09-08 23:02:56 +08:00
|
|
|
file(READ "${SOURCE_PATH}/api/fftw3.h" _contents)
|
2019-05-22 12:04:01 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
string(REPLACE "defined(FFTW_DLL)" "0" _contents "${_contents}")
|
|
|
|
else()
|
|
|
|
string(REPLACE "defined(FFTW_DLL)" "1" _contents "${_contents}")
|
|
|
|
endif()
|
2021-09-08 23:02:56 +08:00
|
|
|
file(WRITE "${SOURCE_PATH}/include/fftw3.h" "${_contents}")
|
2019-03-15 06:24:31 +08:00
|
|
|
|
2021-09-08 23:02:56 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
2019-03-15 06:24:31 +08:00
|
|
|
|
2023-08-10 01:25:30 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
|