Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,25 @@ install (FILES
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
COMPONENT Development)

# pkgconfig files for the threading variants
if (Threads_FOUND AND NOT WITH_COMBINED_THREADS)
set (THREADLIBS "${CMAKE_THREAD_LIBS_INIT}")
configure_file (fftw_threads.pc.in fftw3${PREC_SUFFIX}_threads.pc @ONLY)
install (FILES
${CMAKE_CURRENT_BINARY_DIR}/fftw3${PREC_SUFFIX}_threads.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
COMPONENT Development)
endif ()

if (OPENMP_FOUND)
set (OPENMP_CFLAGS "${OpenMP_C_FLAGS}")
configure_file (fftw_omp.pc.in fftw3${PREC_SUFFIX}_omp.pc @ONLY)
install (FILES
${CMAKE_CURRENT_BINARY_DIR}/fftw3${PREC_SUFFIX}_omp.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
COMPONENT Development)
endif ()

# cmake file
set (FFTW3_LIBRARIES "FFTW3::${fftw3_lib}")
configure_file (FFTW3Config.cmake.in FFTW3${PREC_SUFFIX}Config.cmake @ONLY)
Expand Down
24 changes: 22 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ endif

SUBDIRS=support $(GENFFT) kernel simd-support dft rdft reodft api \
libbench2 $(CHICKEN_EGG) tests mpi $(DOCDIR) tools m4
EXTRA_DIST=COPYRIGHT bootstrap.sh CONVENTIONS fftw.pc.in \
EXTRA_DIST=COPYRIGHT bootstrap.sh CONVENTIONS fftw.pc.in \
fftw_threads.pc.in fftw_omp.pc.in \
CMakeLists.txt cmake.config.h.in FFTW3Config.cmake.in \
FFTW3ConfigVersion.cmake.in README-perfcnt.md

Expand Down Expand Up @@ -165,8 +166,27 @@ endif

fftw3@PREC_SUFFIX@.pc: fftw.pc
cp -f fftw.pc fftw3@PREC_SUFFIX@.pc

# A separate pkg-config file is installed for each threading variant that is
# built. Each one Requires: the base fftw3 package and adds the threaded
# library plus the threading libraries needed when linking statically.
if THREADS
if !COMBINED_THREADS
THREADS_PC = fftw3@PREC_SUFFIX@_threads.pc
endif
endif

if OPENMP
OPENMP_PC = fftw3@PREC_SUFFIX@_omp.pc
endif

fftw3@PREC_SUFFIX@_threads.pc: fftw_threads.pc
cp -f fftw_threads.pc fftw3@PREC_SUFFIX@_threads.pc
fftw3@PREC_SUFFIX@_omp.pc: fftw_omp.pc
cp -f fftw_omp.pc fftw3@PREC_SUFFIX@_omp.pc

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = fftw3@PREC_SUFFIX@.pc
pkgconfig_DATA = fftw3@PREC_SUFFIX@.pc $(THREADS_PC) $(OPENMP_PC)

FFTW3@PREC_SUFFIX@Config.cmake: $(top_srcdir)/FFTW3Config.cmake.in
$(SED) \
Expand Down
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,8 @@ AC_CONFIG_FILES([
m4/Makefile

fftw.pc
fftw_threads.pc
fftw_omp.pc
])

AC_OUTPUT
12 changes: 12 additions & 0 deletions fftw_omp.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@

Name: FFTW OpenMP
Description: fast Fourier transform library, OpenMP variant
Version: @VERSION@
Requires: fftw3@PREC_SUFFIX@
Libs: -L${libdir} -lfftw3@PREC_SUFFIX@_omp
Libs.private: @OPENMP_CFLAGS@ -lm
Cflags: -I${includedir}
12 changes: 12 additions & 0 deletions fftw_threads.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@

Name: FFTW threads
Description: fast Fourier transform library, threaded (pthreads/Win32) variant
Version: @VERSION@
Requires: fftw3@PREC_SUFFIX@
Libs: -L${libdir} -lfftw3@PREC_SUFFIX@_threads
Libs.private: @THREADLIBS@ -lm
Cflags: -I${includedir}