[fftw3] Add openmp to fftw3 (#4351)

This commit is contained in:
John Travers 2019-02-14 22:50:08 +00:00 committed by Codiferous
parent 26e8a0d379
commit 1daccb57b7
3 changed files with 33 additions and 0 deletions

View File

@ -1,3 +1,6 @@
Source: fftw3
Version: 3.3.8
Description: FFTW is a C subroutine library for computing the discrete Fourier transform (DFT) in one or more dimensions, of arbitrary input size, and of both real and complex data (as well as of even/odd data, i.e. the discrete cosine/sine transforms or DCT/DST).
Feature: openmp
Description: Builds openmp enabled lib

View File

@ -0,0 +1,17 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f3cfc20..9826bff 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -385,6 +385,12 @@ if (BUILD_TESTS)
target_link_libraries (bench ${fftw3_lib})
endif ()
+ if (ENABLE_OPENMP)
+ target_link_libraries (bench ${fftw3_lib}_omp)
+ else ()
+ target_link_libraries (bench ${fftw3_lib})
+ endif ()
+
enable_testing ()

View File

@ -17,12 +17,25 @@ vcpkg_download_distfile(ARCHIVE
vcpkg_extract_source_archive(${ARCHIVE})
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
${CMAKE_CURRENT_LIST_DIR}/omp_test.patch
)
if ("openmp" IN_LIST FEATURES)
set(ENABLE_OPENMP ON)
else()
set(ENABLE_OPENMP OFF)
endif()
foreach(PRECISION ENABLE_DEFAULT_PRECISION ENABLE_FLOAT ENABLE_LONG_DOUBLE)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-D${PRECISION}=ON
-DENABLE_OPENMP=${ENABLE_OPENMP}
)
vcpkg_install_cmake()