1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-19 00:13:33 +00:00

math/fftw3: Add missing FFTW3LibraryDepends.cmake

This file would normally be generated by cmake, but since we're using
the more feature-complete and stable autotools configure, instead of
pulling in cmake, just provide a pre-generated template file. This
fixes finding fftw3 with future krita.

Install the cmake configuration files in separate directories for each
flavor so that the exported targets are correctly defined.

See: https://github.com/FFTW/fftw3/issues/130
This commit is contained in:
Jason E. Hale 2023-10-05 00:20:41 -04:00
parent 8517d5b9d9
commit a3fad805f5
3 changed files with 95 additions and 12 deletions

View File

@ -1,6 +1,6 @@
PORTNAME= fftw3
DISTVERSION= 3.3.10
PORTREVISION= 3
PORTREVISION= 4
CATEGORIES= math
MASTER_SITES= http://www.fftw.org/ \
ftp://ftp.fftw.org/pub/fftw/
@ -29,6 +29,17 @@ USE_LDCONFIG= yes
CONFIGURE_ARGS= --enable-shared --enable-threads --disable-fortran
MPIDIR?= ${LOCALBASE}/mpi/openmpi
SHLIB_VER_MAJ= ${DISTVERSION:R:R}
SHLIB_VER_MIN= 6
SHLIB_VER_PAT= ${DISTVERSION:E}
SHLIB_VER= ${SHLIB_VER_MAJ}.${SHLIB_VER_MIN}.${SHLIB_VER_PAT}
PLIST_SUB= SHLIB_VER=${SHLIB_VER} \
SHLIB_VER_MAJ=${SHLIB_VER_MAJ}
SUB_FILES= FFTW3LibraryDepends.cmake
SUB_LIST= FFTW3_SUFX=${FFTW3_SUFX} \
SHLIB_VER=${SHLIB_VER} \
SHLIB_VER_MAJ=${SHLIB_VER_MAJ}
.if ${FFTW3_FLAVOR} == "default"
INFO= fftw3
.else
@ -145,6 +156,8 @@ post-patch:
${WRKSRC}/api/import-system-wisdom.c \
${WRKSRC}/doc/fftw3* \
${WRKSRC}/tools/*
@${REINPLACE_CMD} -e '/^cmakedir/s|fftw3|fftw3@PREC_SUFFIX@|' \
${WRKSRC}/Makefile.in
.if ${FFTW3_FLAVOR} != "default"
@${REINPLACE_CMD} -E \
-e '/(DIST_COMMON|bin_SCRIPTS|BUILT_SOURCES|EXTRA_DIST) =/,\
@ -164,8 +177,9 @@ post-configure:
post-configure-G77_WRAPPERS-on:
@${ECHO_CMD} "#define WITH_G77_WRAPPERS 1" >> ${WRKSRC}/config.h
.if ${FFTW3_FLAVOR} != "default"
post-install:
${INSTALL_DATA} ${WRKDIR}/FFTW3LibraryDepends.cmake ${STAGEDIR}${PREFIX}/lib/cmake/fftw3${FFTW3_SUFX}
.if ${FFTW3_FLAVOR} != "default"
${INSTALL_MAN} ${WRKSRC}/tools/fftw${FFTW3_SUFX}-wisdom.1 ${STAGEDIR}${PREFIX}/man/man1
${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/lib*.so
.endif

View File

@ -0,0 +1,68 @@
# Generated by CMake
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
message(FATAL_ERROR "CMake >= 2.8.0 required")
endif()
if(CMAKE_VERSION VERSION_LESS "2.8.3")
message(FATAL_ERROR "CMake >= 2.8.3 required")
endif()
cmake_policy(PUSH)
cmake_policy(VERSION 2.8.3...3.25)
#----------------------------------------------------------------
# Generated CMake target import file.
#----------------------------------------------------------------
# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)
# Protect against multiple inclusion, which would fail when already imported targets are added once more.
set(_cmake_targets_defined "")
set(_cmake_targets_not_defined "")
set(_cmake_expected_targets "")
foreach(_cmake_expected_target IN ITEMS FFTW3::fftw3%%FFTW3_SUFX%%)
list(APPEND _cmake_expected_targets "${_cmake_expected_target}")
if(TARGET "${_cmake_expected_target}")
list(APPEND _cmake_targets_defined "${_cmake_expected_target}")
else()
list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}")
endif()
endforeach()
unset(_cmake_expected_target)
if(_cmake_targets_defined STREQUAL _cmake_expected_targets)
unset(_cmake_targets_defined)
unset(_cmake_targets_not_defined)
unset(_cmake_expected_targets)
unset(CMAKE_IMPORT_FILE_VERSION)
cmake_policy(POP)
return()
endif()
if(NOT _cmake_targets_defined STREQUAL "")
string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}")
string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}")
message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n")
endif()
unset(_cmake_targets_defined)
unset(_cmake_targets_not_defined)
unset(_cmake_expected_targets)
# Create imported target FFTW3::fftw3%%FFTW3_SUFX%%
add_library(FFTW3::fftw3%%FFTW3_SUFX%% SHARED IMPORTED)
set_target_properties(FFTW3::fftw3%%FFTW3_SUFX%% PROPERTIES
INTERFACE_LINK_LIBRARIES "m"
)
# Import target "FFTW3::fftw3%%FFTW3_SUFX%%" for configuration "Release"
set_property(TARGET FFTW3::fftw3%%FFTW3_SUFX%% APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(FFTW3::fftw3%%FFTW3_SUFX%% PROPERTIES
IMPORTED_LOCATION_RELEASE "%%LOCALBASE%%/lib/libfftw3%%FFTW3_SUFX%%.so.%%SHLIB_VER_MAJ%%"
IMPORTED_SONAME_RELEASE "libfftw3%%FFTW3_SUFX%%.so.%%SHLIB_VER%%"
)
# This file does not depend on other imported targets which have
# been exported from the same project but in a separate export set.
# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)
cmake_policy(POP)

View File

@ -8,24 +8,25 @@ bin/fftw%%FFTW3_SUFX%%-wisdom
%%DEF%%%%OPENMPI%%include/fftw3l-mpi.f03
%%DEF%%include/fftw3l.f03
%%DEF%%include/fftw3q.f03
lib/cmake/fftw3/FFTW3%%FFTW3_SUFX%%Config.cmake
lib/cmake/fftw3/FFTW3%%FFTW3_SUFX%%ConfigVersion.cmake
lib/cmake/fftw3%%FFTW3_SUFX%%/FFTW3%%FFTW3_SUFX%%Config.cmake
lib/cmake/fftw3%%FFTW3_SUFX%%/FFTW3%%FFTW3_SUFX%%ConfigVersion.cmake
lib/cmake/fftw3%%FFTW3_SUFX%%/FFTW3LibraryDepends.cmake
lib/libfftw3%%FFTW3_SUFX%%.a
lib/libfftw3%%FFTW3_SUFX%%.so
lib/libfftw3%%FFTW3_SUFX%%.so.3
lib/libfftw3%%FFTW3_SUFX%%.so.3.6.10
lib/libfftw3%%FFTW3_SUFX%%.so.%%SHLIB_VER_MAJ%%
lib/libfftw3%%FFTW3_SUFX%%.so.%%SHLIB_VER%%
%%OPENMPI%%lib/libfftw3%%FFTW3_SUFX%%_mpi.a
%%OPENMPI%%lib/libfftw3%%FFTW3_SUFX%%_mpi.so
%%OPENMPI%%lib/libfftw3%%FFTW3_SUFX%%_mpi.so.3
%%OPENMPI%%lib/libfftw3%%FFTW3_SUFX%%_mpi.so.3.6.10
%%OPENMPI%%lib/libfftw3%%FFTW3_SUFX%%_mpi.so.%%SHLIB_VER_MAJ%%
%%OPENMPI%%lib/libfftw3%%FFTW3_SUFX%%_mpi.so.%%SHLIB_VER%%
%%OPENMP%%lib/libfftw3%%FFTW3_SUFX%%_omp.a
%%OPENMP%%lib/libfftw3%%FFTW3_SUFX%%_omp.so
%%OPENMP%%lib/libfftw3%%FFTW3_SUFX%%_omp.so.3
%%OPENMP%%lib/libfftw3%%FFTW3_SUFX%%_omp.so.3.6.10
%%OPENMP%%lib/libfftw3%%FFTW3_SUFX%%_omp.so.%%SHLIB_VER_MAJ%%
%%OPENMP%%lib/libfftw3%%FFTW3_SUFX%%_omp.so.%%SHLIB_VER%%
lib/libfftw3%%FFTW3_SUFX%%_threads.a
lib/libfftw3%%FFTW3_SUFX%%_threads.so
lib/libfftw3%%FFTW3_SUFX%%_threads.so.3
lib/libfftw3%%FFTW3_SUFX%%_threads.so.3.6.10
lib/libfftw3%%FFTW3_SUFX%%_threads.so.%%SHLIB_VER_MAJ%%
lib/libfftw3%%FFTW3_SUFX%%_threads.so.%%SHLIB_VER%%
libdata/pkgconfig/fftw3%%FFTW3_SUFX%%.pc
%%DEF%%man/man1/fftw-wisdom.1.gz
%%DEF%%man/man1/fftw-wisdom-to-conf.1.gz