aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Riebesel <nicolas.riebesel@gmx.com>2017-03-06 09:17:07 +0100
committerNicolas Riebesel <nicolas.riebesel@gmx.com>2017-03-06 09:17:07 +0100
commitcb1cf039d80c126b654ebb1c68a69c29a5f7b61b (patch)
tree8ae4db95cb2aec6724c948c3720d02ab80bad29b
parente89d6f54a3931834991baf69b7289104305bd415 (diff)
downloadvcpkg-cb1cf039d80c126b654ebb1c68a69c29a5f7b61b.tar.gz
vcpkg-cb1cf039d80c126b654ebb1c68a69c29a5f7b61b.zip
Improve the static vs dynamic handling of fftw3
-rw-r--r--ports/fftw3/CMakeLists.txt6
-rw-r--r--ports/fftw3/fix-dynamic.patch4
-rw-r--r--ports/fftw3/portfile.cmake19
3 files changed, 15 insertions, 14 deletions
diff --git a/ports/fftw3/CMakeLists.txt b/ports/fftw3/CMakeLists.txt
index e2ce63b30..88f7a2517 100644
--- a/ports/fftw3/CMakeLists.txt
+++ b/ports/fftw3/CMakeLists.txt
@@ -6,9 +6,13 @@ project (fftw3)
# Standard: /DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR
if (WIN32)
set(CMAKE_CXX_FLAGS "/DWIN32 /D_WINDOWS /W4 /Zi /EHsc /GR- /MP /openmp /bigobj")
- add_definitions(-D_OPENMP -DFFTW_DLL -DLIBFFTWF33_EXPORTS) # Visual Studio 2005 and up supports OpenMP
+ add_definitions(-D_OPENMP -DLIBFFTWF33_EXPORTS) # Visual Studio 2005 and up supports OpenMP
endif (WIN32)
+if (BUILD_SHARED_LIBS)
+ add_definitions(-DFFTW_DLL)
+endif()
+
file(GLOB fftw_api_SOURCE api/*.c api/*.h)
file(GLOB fftw_dft_SOURCE dft/*.c dft/*.h)
diff --git a/ports/fftw3/fix-dynamic.patch b/ports/fftw3/fix-dynamic.patch
index 0ebbc87a4..a39d1b968 100644
--- a/ports/fftw3/fix-dynamic.patch
+++ b/ports/fftw3/fix-dynamic.patch
@@ -1,5 +1,5 @@
---- a/api/fftw3.h 2017-01-15 13:03:24.000000000 +0100
-+++ b/api/fftw3.h 2017-02-24 04:05:36.051091700 +0100
+--- a/fftw3.h 2017-01-15 13:03:24.000000000 +0100
++++ b/fftw3.h 2017-02-24 04:05:36.051091700 +0100
@@ -47,6 +47,8 @@
#ifndef FFTW3_H
#define FFTW3_H
diff --git a/ports/fftw3/portfile.cmake b/ports/fftw3/portfile.cmake
index f982e85f0..fe97533b4 100644
--- a/ports/fftw3/portfile.cmake
+++ b/ports/fftw3/portfile.cmake
@@ -16,22 +16,12 @@ vcpkg_download_distfile(ARCHIVE
vcpkg_extract_source_archive(${ARCHIVE})
-if (VCPKG_CRT_LINKAGE STREQUAL dynamic)
- vcpkg_apply_patches(
- SOURCE_PATH ${SOURCE_PATH}
- PATCHES
- ${CMAKE_CURRENT_LIST_DIR}/fix-dynamic.patch)
-endif()
-
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/config.h DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
- PREFER_NINJA # Disable this option if project cannot be built with Ninja
- # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2
- # OPTIONS_RELEASE -DOPTIMIZE=1
- # OPTIONS_DEBUG -DDEBUGGABLE=1
+ PREFER_NINJA
)
vcpkg_install_cmake()
@@ -39,6 +29,13 @@ vcpkg_copy_pdbs()
file(COPY ${SOURCE_PATH}/api/fftw3.h DESTINATION ${CURRENT_PACKAGES_DIR}/include)
+if (VCPKG_CRT_LINKAGE STREQUAL dynamic)
+ vcpkg_apply_patches(
+ SOURCE_PATH ${CURRENT_PACKAGES_DIR}/include
+ PATCHES
+ ${CMAKE_CURRENT_LIST_DIR}/fix-dynamic.patch)
+endif()
+
# Handle copyright
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/fftw3)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/fftw3/COPYING ${CURRENT_PACKAGES_DIR}/share/fftw3/copyright)