To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
The primary repository for this project is hosted at https://github.com/sonic-visualiser/sv-dependency-builds .
This repository is a read-only copy which is updated automatically every hour.
root / src / fftw-3.3.8 / CMakeLists.txt @ 167:bd3cc4d1df30
History | View | Annotate | Download (14.5 KB)
| 1 |
cmake_minimum_required (VERSION 3.0) |
|---|---|
| 2 |
|
| 3 |
if (NOT DEFINED CMAKE_BUILD_TYPE) |
| 4 |
set (CMAKE_BUILD_TYPE Release CACHE STRING "Build type") |
| 5 |
endif () |
| 6 |
|
| 7 |
project (fftw) |
| 8 |
|
| 9 |
if (POLICY CMP0042) |
| 10 |
cmake_policy (SET CMP0042 NEW) |
| 11 |
endif () |
| 12 |
|
| 13 |
option (BUILD_SHARED_LIBS "Build shared libraries" ON) |
| 14 |
option (BUILD_TESTS "Build tests" ON) |
| 15 |
|
| 16 |
option (ENABLE_OPENMP "Use OpenMP for multithreading" OFF) |
| 17 |
option (ENABLE_THREADS "Use pthread for multithreading" OFF) |
| 18 |
option (WITH_COMBINED_THREADS "Merge thread library" OFF) |
| 19 |
|
| 20 |
option (ENABLE_FLOAT "single-precision" OFF) |
| 21 |
option (ENABLE_LONG_DOUBLE "long-double precision" OFF) |
| 22 |
option (ENABLE_QUAD_PRECISION "quadruple-precision" OFF) |
| 23 |
|
| 24 |
option (ENABLE_SSE "Compile with SSE instruction set support" OFF) |
| 25 |
option (ENABLE_SSE2 "Compile with SSE2 instruction set support" OFF) |
| 26 |
option (ENABLE_AVX "Compile with AVX instruction set support" OFF) |
| 27 |
option (ENABLE_AVX2 "Compile with AVX2 instruction set support" OFF) |
| 28 |
|
| 29 |
option (DISABLE_FORTRAN "Disable Fortran wrapper routines" OFF) |
| 30 |
|
| 31 |
include(GNUInstallDirs) |
| 32 |
|
| 33 |
|
| 34 |
include (CheckIncludeFile) |
| 35 |
check_include_file (alloca.h HAVE_ALLOCA_H) |
| 36 |
check_include_file (altivec.h HAVE_ALTIVEC_H) |
| 37 |
check_include_file (c_asm.h HAVE_C_ASM_H) |
| 38 |
check_include_file (dlfcn.h HAVE_DLFCN_H) |
| 39 |
check_include_file (intrinsics.h HAVE_INTRINSICS_H) |
| 40 |
check_include_file (inttypes.h HAVE_INTTYPES_H) |
| 41 |
check_include_file (libintl.h HAVE_LIBINTL_H) |
| 42 |
check_include_file (limits.h HAVE_LIMITS_H) |
| 43 |
check_include_file (mach/mach_time.h HAVE_MACH_MACH_TIME_H) |
| 44 |
check_include_file (malloc.h HAVE_MALLOC_H) |
| 45 |
check_include_file (memory.h HAVE_MEMORY_H) |
| 46 |
check_include_file (stddef.h HAVE_STDDEF_H) |
| 47 |
check_include_file (stdint.h HAVE_STDINT_H) |
| 48 |
check_include_file (stdlib.h HAVE_STDLIB_H) |
| 49 |
check_include_file (string.h HAVE_STRING_H) |
| 50 |
check_include_file (strings.h HAVE_STRINGS_H) |
| 51 |
check_include_file (sys/types.h HAVE_SYS_TYPES_H) |
| 52 |
check_include_file (sys/time.h HAVE_SYS_TIME_H) |
| 53 |
check_include_file (sys/stat.h HAVE_SYS_STAT_H) |
| 54 |
check_include_file (sys/sysctl.h HAVE_SYS_SYSCTL_H) |
| 55 |
check_include_file (time.h HAVE_TIME_H) |
| 56 |
check_include_file (uintptr.h HAVE_UINTPTR_H) |
| 57 |
check_include_file (unistd.h HAVE_UNISTD_H) |
| 58 |
if (HAVE_TIME_H AND HAVE_SYS_TIME_H) |
| 59 |
set (TIME_WITH_SYS_TIME TRUE) |
| 60 |
endif () |
| 61 |
|
| 62 |
include (CheckPrototypeDefinition) |
| 63 |
check_prototype_definition (drand48 "double drand48 (void)" "0" stdlib.h HAVE_DECL_DRAND48) |
| 64 |
check_prototype_definition (srand48 "void srand48(long int seedval)" "0" stdlib.h HAVE_DECL_SRAND48) |
| 65 |
check_prototype_definition (cosl "long double cosl( long double arg )" "0" math.h HAVE_DECL_COSL) |
| 66 |
check_prototype_definition (sinl "long double sinl( long double arg )" "0" math.h HAVE_DECL_SINL) |
| 67 |
check_prototype_definition (memalign "void *memalign(size_t alignment, size_t size)" "0" malloc.h HAVE_DECL_MEMALIGN) |
| 68 |
check_prototype_definition (posix_memalign "int posix_memalign(void **memptr, size_t alignment, size_t size)" "0" stdlib.h HAVE_DECL_POSIX_MEMALIGN) |
| 69 |
|
| 70 |
include (CheckSymbolExists) |
| 71 |
check_symbol_exists (clock_gettime time.h HAVE_CLOCK_GETTIME) |
| 72 |
check_symbol_exists (gettimeofday sys/time.h HAVE_GETTIMEOFDAY) |
| 73 |
check_symbol_exists (getpagesize unistd.h HAVE_GETPAGESIZE) |
| 74 |
check_symbol_exists (drand48 stdlib.h HAVE_DRAND48) |
| 75 |
check_symbol_exists (srand48 stdlib.h HAVE_SRAND48) |
| 76 |
check_symbol_exists (memalign malloc.h HAVE_MEMALIGN) |
| 77 |
check_symbol_exists (posix_memalign stdlib.h HAVE_POSIX_MEMALIGN) |
| 78 |
check_symbol_exists (mach_absolute_time mach/mach_time.h HAVE_MACH_ABSOLUTE_TIME) |
| 79 |
check_symbol_exists (alloca alloca.h HAVE_ALLOCA) |
| 80 |
if (NOT HAVE_ALLOCA) |
| 81 |
unset (HAVE_ALLOCA CACHE) |
| 82 |
check_symbol_exists (alloca malloc.h HAVE_ALLOCA) |
| 83 |
endif () |
| 84 |
check_symbol_exists (isnan math.h HAVE_ISNAN) |
| 85 |
check_symbol_exists (snprintf stdio.h HAVE_SNPRINTF) |
| 86 |
check_symbol_exists (strchr string.h HAVE_STRCHR) |
| 87 |
check_symbol_exists (sysctl unistd.h HAVE_SYSCTL) |
| 88 |
|
| 89 |
if (UNIX) |
| 90 |
set (CMAKE_REQUIRED_LIBRARIES m) |
| 91 |
endif () |
| 92 |
check_symbol_exists (cosl math.h HAVE_COSL) |
| 93 |
check_symbol_exists (sinl math.h HAVE_SINL) |
| 94 |
|
| 95 |
include (CheckTypeSize) |
| 96 |
check_type_size ("float" SIZEOF_FLOAT)
|
| 97 |
check_type_size ("double" SIZEOF_DOUBLE)
|
| 98 |
check_type_size ("int" SIZEOF_INT)
|
| 99 |
check_type_size ("long" SIZEOF_LONG)
|
| 100 |
check_type_size ("long long" SIZEOF_LONG_LONG)
|
| 101 |
check_type_size ("unsigned int" SIZEOF_UNSIGNED_INT)
|
| 102 |
check_type_size ("unsigned long" SIZEOF_UNSIGNED_LONG)
|
| 103 |
check_type_size ("unsigned long long" SIZEOF_UNSIGNED_LONG_LONG)
|
| 104 |
check_type_size ("size_t" SIZEOF_SIZE_T)
|
| 105 |
check_type_size ("ptrdiff_t" SIZEOF_PTRDIFF_T)
|
| 106 |
math (EXPR SIZEOF_INT_BITS "8 * ${SIZEOF_INT}")
|
| 107 |
set (C_FFTW_R2R_KIND "C_INT${SIZEOF_INT_BITS}_T")
|
| 108 |
|
| 109 |
find_library (LIBM_LIBRARY NAMES m) |
| 110 |
if (LIBM_LIBRARY) |
| 111 |
set (HAVE_LIBM TRUE) |
| 112 |
endif () |
| 113 |
|
| 114 |
|
| 115 |
if (ENABLE_THREADS) |
| 116 |
find_package (Threads) |
| 117 |
endif () |
| 118 |
if (Threads_FOUND) |
| 119 |
if(CMAKE_USE_PTHREADS_INIT) |
| 120 |
set (USING_POSIX_THREADS 1) |
| 121 |
endif () |
| 122 |
set (HAVE_THREADS TRUE) |
| 123 |
endif () |
| 124 |
|
| 125 |
if (ENABLE_OPENMP) |
| 126 |
find_package (OpenMP) |
| 127 |
endif () |
| 128 |
if (OPENMP_FOUND) |
| 129 |
set (HAVE_OPENMP TRUE) |
| 130 |
endif () |
| 131 |
|
| 132 |
include (CheckCCompilerFlag) |
| 133 |
|
| 134 |
if (ENABLE_SSE) |
| 135 |
foreach (FLAG "-msse" "/arch:SSE") |
| 136 |
unset (HAVE_SSE CACHE) |
| 137 |
check_c_compiler_flag (${FLAG} HAVE_SSE)
|
| 138 |
if (HAVE_SSE) |
| 139 |
set (SSE_FLAG ${FLAG})
|
| 140 |
break() |
| 141 |
endif () |
| 142 |
endforeach () |
| 143 |
endif () |
| 144 |
|
| 145 |
if (ENABLE_SSE2) |
| 146 |
foreach (FLAG "-msse2" "/arch:SSE2") |
| 147 |
unset (HAVE_SSE2 CACHE) |
| 148 |
check_c_compiler_flag (${FLAG} HAVE_SSE2)
|
| 149 |
if (HAVE_SSE2) |
| 150 |
set (SSE2_FLAG ${FLAG})
|
| 151 |
break() |
| 152 |
endif () |
| 153 |
endforeach () |
| 154 |
endif () |
| 155 |
|
| 156 |
if (ENABLE_AVX) |
| 157 |
foreach (FLAG "-mavx" "/arch:AVX") |
| 158 |
unset (HAVE_AVX CACHE) |
| 159 |
check_c_compiler_flag (${FLAG} HAVE_AVX)
|
| 160 |
if (HAVE_AVX) |
| 161 |
set (AVX_FLAG ${FLAG})
|
| 162 |
break() |
| 163 |
endif () |
| 164 |
endforeach () |
| 165 |
endif () |
| 166 |
|
| 167 |
if (ENABLE_AVX2) |
| 168 |
foreach (FLAG "-mavx2" "/arch:AVX2") |
| 169 |
unset (HAVE_AVX2 CACHE) |
| 170 |
check_c_compiler_flag (${FLAG} HAVE_AVX2)
|
| 171 |
if (HAVE_AVX2) |
| 172 |
set (AVX2_FLAG ${FLAG})
|
| 173 |
break() |
| 174 |
endif () |
| 175 |
endforeach () |
| 176 |
endif () |
| 177 |
|
| 178 |
# AVX2 codelets require FMA support as well |
| 179 |
if (ENABLE_AVX2) |
| 180 |
foreach (FLAG "-mfma" "/arch:FMA") |
| 181 |
unset (HAVE_FMA CACHE) |
| 182 |
check_c_compiler_flag (${FLAG} HAVE_FMA)
|
| 183 |
if (HAVE_FMA) |
| 184 |
set (FMA_FLAG ${FLAG})
|
| 185 |
break() |
| 186 |
endif () |
| 187 |
endforeach () |
| 188 |
endif () |
| 189 |
|
| 190 |
if (HAVE_SSE2 OR HAVE_AVX) |
| 191 |
set (HAVE_SIMD TRUE) |
| 192 |
endif () |
| 193 |
file(GLOB fftw_api_SOURCE api/*.c api/*.h) |
| 194 |
file(GLOB fftw_dft_SOURCE dft/*.c dft/*.h) |
| 195 |
file(GLOB fftw_dft_scalar_SOURCE dft/scalar/*.c dft/scalar/*.h) |
| 196 |
file(GLOB fftw_dft_scalar_codelets_SOURCE dft/scalar/codelets/*.c dft/scalar/codelets/*.h) |
| 197 |
file(GLOB fftw_dft_simd_SOURCE dft/simd/*.c dft/simd/*.h) |
| 198 |
|
| 199 |
file(GLOB fftw_dft_simd_sse2_SOURCE dft/simd/sse2/*.c dft/simd/sse2/*.h) |
| 200 |
file(GLOB fftw_dft_simd_avx_SOURCE dft/simd/avx/*.c dft/simd/avx/*.h) |
| 201 |
file(GLOB fftw_dft_simd_avx2_SOURCE dft/simd/avx2/*.c dft/simd/avx2/*.h dft/simd/avx2-128/*.c dft/simd/avx2-128/*.h) |
| 202 |
file(GLOB fftw_kernel_SOURCE kernel/*.c kernel/*.h) |
| 203 |
file(GLOB fftw_rdft_SOURCE rdft/*.c rdft/*.h) |
| 204 |
file(GLOB fftw_rdft_scalar_SOURCE rdft/scalar/*.c rdft/scalar/*.h) |
| 205 |
|
| 206 |
file(GLOB fftw_rdft_scalar_r2cb_SOURCE rdft/scalar/r2cb/*.c |
| 207 |
rdft/scalar/r2cb/*.h) |
| 208 |
file(GLOB fftw_rdft_scalar_r2cf_SOURCE rdft/scalar/r2cf/*.c |
| 209 |
rdft/scalar/r2cf/*.h) |
| 210 |
file(GLOB fftw_rdft_scalar_r2r_SOURCE rdft/scalar/r2r/*.c |
| 211 |
rdft/scalar/r2r/*.h) |
| 212 |
|
| 213 |
file(GLOB fftw_rdft_simd_SOURCE rdft/simd/*.c rdft/simd/*.h) |
| 214 |
file(GLOB fftw_rdft_simd_sse2_SOURCE rdft/simd/sse2/*.c rdft/simd/sse2/*.h) |
| 215 |
file(GLOB fftw_rdft_simd_avx_SOURCE rdft/simd/avx/*.c rdft/simd/avx/*.h) |
| 216 |
file(GLOB fftw_rdft_simd_avx2_SOURCE rdft/simd/avx2/*.c rdft/simd/avx2/*.h rdft/simd/avx2-128/*.c rdft/simd/avx2-128/*.h) |
| 217 |
|
| 218 |
file(GLOB fftw_reodft_SOURCE reodft/*.c reodft/*.h) |
| 219 |
file(GLOB fftw_simd_support_SOURCE simd-support/*.c simd-support/*.h) |
| 220 |
file(GLOB fftw_libbench2_SOURCE libbench2/*.c libbench2/*.h) |
| 221 |
list (REMOVE_ITEM fftw_libbench2_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/libbench2/useropt.c)
|
| 222 |
|
| 223 |
set(SOURCEFILES |
| 224 |
${fftw_api_SOURCE}
|
| 225 |
${fftw_dft_SOURCE}
|
| 226 |
${fftw_dft_scalar_SOURCE}
|
| 227 |
${fftw_dft_scalar_codelets_SOURCE}
|
| 228 |
${fftw_dft_simd_SOURCE}
|
| 229 |
${fftw_kernel_SOURCE}
|
| 230 |
${fftw_rdft_SOURCE}
|
| 231 |
${fftw_rdft_scalar_SOURCE}
|
| 232 |
|
| 233 |
${fftw_rdft_scalar_r2cb_SOURCE}
|
| 234 |
${fftw_rdft_scalar_r2cf_SOURCE}
|
| 235 |
${fftw_rdft_scalar_r2r_SOURCE}
|
| 236 |
|
| 237 |
${fftw_rdft_simd_SOURCE}
|
| 238 |
${fftw_reodft_SOURCE}
|
| 239 |
${fftw_simd_support_SOURCE}
|
| 240 |
${fftw_threads_SOURCE}
|
| 241 |
) |
| 242 |
|
| 243 |
set(fftw_par_SOURCE |
| 244 |
threads/api.c |
| 245 |
threads/conf.c |
| 246 |
threads/ct.c |
| 247 |
threads/dft-vrank-geq1.c |
| 248 |
threads/f77api.c |
| 249 |
threads/hc2hc.c |
| 250 |
threads/rdft-vrank-geq1.c |
| 251 |
threads/vrank-geq1-rdft2.c) |
| 252 |
|
| 253 |
set (fftw_threads_SOURCE ${fftw_par_SOURCE} threads/threads.c)
|
| 254 |
set (fftw_omp_SOURCE ${fftw_par_SOURCE} threads/openmp.c)
|
| 255 |
|
| 256 |
|
| 257 |
include_directories (.) |
| 258 |
|
| 259 |
|
| 260 |
if (WITH_COMBINED_THREADS) |
| 261 |
list (APPEND SOURCEFILES ${fftw_threads_SOURCE})
|
| 262 |
endif () |
| 263 |
|
| 264 |
|
| 265 |
if (HAVE_SSE2) |
| 266 |
list (APPEND SOURCEFILES ${fftw_dft_simd_sse2_SOURCE} ${fftw_rdft_simd_sse2_SOURCE})
|
| 267 |
endif () |
| 268 |
|
| 269 |
if (HAVE_AVX) |
| 270 |
list (APPEND SOURCEFILES ${fftw_dft_simd_avx_SOURCE} ${fftw_rdft_simd_avx_SOURCE})
|
| 271 |
endif () |
| 272 |
|
| 273 |
if (HAVE_AVX2) |
| 274 |
list (APPEND SOURCEFILES ${fftw_dft_simd_avx2_SOURCE} ${fftw_rdft_simd_avx2_SOURCE})
|
| 275 |
endif () |
| 276 |
|
| 277 |
set (FFTW_VERSION 3.3.7) |
| 278 |
|
| 279 |
set (PREC_SUFFIX) |
| 280 |
if (ENABLE_FLOAT) |
| 281 |
set (FFTW_SINGLE TRUE) |
| 282 |
set (BENCHFFT_SINGLE TRUE) |
| 283 |
set (PREC_SUFFIX f) |
| 284 |
endif () |
| 285 |
|
| 286 |
if (ENABLE_LONG_DOUBLE) |
| 287 |
set (FFTW_LDOUBLE TRUE) |
| 288 |
set (BENCHFFT_LDOUBLE TRUE) |
| 289 |
set (PREC_SUFFIX l) |
| 290 |
endif () |
| 291 |
|
| 292 |
if (ENABLE_QUAD_PRECISION) |
| 293 |
set (FFTW_QUAD TRUE) |
| 294 |
set (BENCHFFT_QUAD TRUE) |
| 295 |
set (PREC_SUFFIX q) |
| 296 |
endif () |
| 297 |
set (fftw3_lib fftw3${PREC_SUFFIX})
|
| 298 |
|
| 299 |
configure_file (cmake.config.h.in config.h @ONLY) |
| 300 |
include_directories (${CMAKE_CURRENT_BINARY_DIR})
|
| 301 |
|
| 302 |
if (BUILD_SHARED_LIBS) |
| 303 |
add_definitions (-DFFTW_DLL) |
| 304 |
endif () |
| 305 |
|
| 306 |
add_library (${fftw3_lib} ${SOURCEFILES})
|
| 307 |
target_include_directories (${fftw3_lib} INTERFACE $<INSTALL_INTERFACE:include>)
|
| 308 |
if (MSVC) |
| 309 |
target_compile_definitions (${fftw3_lib} PRIVATE /bigobj)
|
| 310 |
endif () |
| 311 |
if (HAVE_SSE) |
| 312 |
target_compile_options (${fftw3_lib} PRIVATE ${SSE_FLAG})
|
| 313 |
endif () |
| 314 |
if (HAVE_SSE2) |
| 315 |
target_compile_options (${fftw3_lib} PRIVATE ${SSE2_FLAG})
|
| 316 |
endif () |
| 317 |
if (HAVE_AVX) |
| 318 |
target_compile_options (${fftw3_lib} PRIVATE ${AVX_FLAG})
|
| 319 |
endif () |
| 320 |
if (HAVE_AVX2) |
| 321 |
target_compile_options (${fftw3_lib} PRIVATE ${AVX2_FLAG})
|
| 322 |
endif () |
| 323 |
if (HAVE_FMA) |
| 324 |
target_compile_options (${fftw3_lib} PRIVATE ${FMA_FLAG})
|
| 325 |
endif () |
| 326 |
if (HAVE_LIBM) |
| 327 |
target_link_libraries (${fftw3_lib} m)
|
| 328 |
endif () |
| 329 |
|
| 330 |
set (subtargets ${fftw3_lib})
|
| 331 |
|
| 332 |
if (Threads_FOUND) |
| 333 |
if (WITH_COMBINED_THREADS) |
| 334 |
target_link_libraries (${fftw3_lib} ${CMAKE_THREAD_LIBS_INIT})
|
| 335 |
else () |
| 336 |
add_library (${fftw3_lib}_threads ${fftw_threads_SOURCE})
|
| 337 |
target_include_directories (${fftw3_lib}_threads INTERFACE $<INSTALL_INTERFACE:include>)
|
| 338 |
target_link_libraries (${fftw3_lib}_threads ${fftw3_lib})
|
| 339 |
target_link_libraries (${fftw3_lib}_threads ${CMAKE_THREAD_LIBS_INIT})
|
| 340 |
list (APPEND subtargets ${fftw3_lib}_threads)
|
| 341 |
endif () |
| 342 |
endif () |
| 343 |
|
| 344 |
if (OPENMP_FOUND) |
| 345 |
add_library (${fftw3_lib}_omp ${fftw_omp_SOURCE})
|
| 346 |
target_include_directories (${fftw3_lib}_omp INTERFACE $<INSTALL_INTERFACE:include>)
|
| 347 |
target_link_libraries (${fftw3_lib}_omp ${fftw3_lib})
|
| 348 |
target_link_libraries (${fftw3_lib}_omp ${CMAKE_THREAD_LIBS_INIT})
|
| 349 |
list (APPEND subtargets ${fftw3_lib}_omp)
|
| 350 |
target_compile_options (${fftw3_lib}_omp PRIVATE ${OpenMP_C_FLAGS})
|
| 351 |
endif () |
| 352 |
|
| 353 |
foreach(subtarget ${subtargets})
|
| 354 |
set_target_properties (${subtarget} PROPERTIES SOVERSION 3.5.7 VERSION 3)
|
| 355 |
install (TARGETS ${subtarget}
|
| 356 |
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
| 357 |
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
| 358 |
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
| 359 |
endforeach () |
| 360 |
install(TARGETS ${fftw3_lib}
|
| 361 |
EXPORT FFTW3LibraryDepends |
| 362 |
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
| 363 |
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
| 364 |
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
| 365 |
|
| 366 |
install (FILES api/fftw3.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
| 367 |
if (EXISTS ${CMAKE_SOURCE_DIR}/api/fftw3.f)
|
| 368 |
install (FILES api/fftw3.f api/fftw3l.f03 api/fftw3q.f03 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
| 369 |
endif () |
| 370 |
if (EXISTS ${CMAKE_SOURCE_DIR}/api/fftw3.f03.in)
|
| 371 |
file (READ api/fftw3.f03.in FFTW3_F03_IN OFFSET 42) |
| 372 |
file (WRITE ${CMAKE_CURRENT_BINARY_DIR}/fftw3.f03 "! Generated automatically. DO NOT EDIT!\n\n")
|
| 373 |
file (APPEND ${CMAKE_CURRENT_BINARY_DIR}/fftw3.f03 " integer, parameter :: C_FFTW_R2R_KIND = ${C_FFTW_R2R_KIND}\n\n")
|
| 374 |
file (APPEND ${CMAKE_CURRENT_BINARY_DIR}/fftw3.f03 "${FFTW3_F03_IN}")
|
| 375 |
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/fftw3.f03 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
| 376 |
endif () |
| 377 |
|
| 378 |
if (BUILD_TESTS) |
| 379 |
|
| 380 |
add_executable (bench ${fftw_libbench2_SOURCE} tests/bench.c tests/hook.c tests/fftw-bench.c)
|
| 381 |
|
| 382 |
if (ENABLE_THREADS AND NOT WITH_COMBINED_THREADS) |
| 383 |
target_link_libraries (bench ${fftw3_lib}_threads)
|
| 384 |
else () |
| 385 |
target_link_libraries (bench ${fftw3_lib})
|
| 386 |
endif () |
| 387 |
|
| 388 |
|
| 389 |
enable_testing () |
| 390 |
|
| 391 |
if (Threads_FOUND) |
| 392 |
|
| 393 |
macro (fftw_add_test problem) |
| 394 |
add_test (NAME ${problem} COMMAND bench -s ${problem})
|
| 395 |
endmacro () |
| 396 |
|
| 397 |
fftw_add_test (32x64) |
| 398 |
fftw_add_test (ib256) |
| 399 |
|
| 400 |
endif () |
| 401 |
endif () |
| 402 |
|
| 403 |
# pkgconfig file |
| 404 |
set (prefix ${CMAKE_INSTALL_PREFIX})
|
| 405 |
set (exec_prefix ${CMAKE_INSTALL_PREFIX})
|
| 406 |
set (libdir ${CMAKE_INSTALL_FULL_LIBDIR})
|
| 407 |
set (includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
|
| 408 |
set (VERSION ${FFTW_VERSION})
|
| 409 |
configure_file (fftw.pc.in fftw${PREC_SUFFIX}.pc @ONLY)
|
| 410 |
install (FILES |
| 411 |
${CMAKE_CURRENT_BINARY_DIR}/fftw${PREC_SUFFIX}.pc
|
| 412 |
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
|
| 413 |
COMPONENT Development) |
| 414 |
|
| 415 |
# cmake file |
| 416 |
set (FFTW3_LIBRARIES "FFTW3::${fftw3_lib}")
|
| 417 |
configure_file (FFTW3Config.cmake.in FFTW3${PREC_SUFFIX}Config.cmake @ONLY)
|
| 418 |
configure_file (FFTW3ConfigVersion.cmake.in FFTW3${PREC_SUFFIX}ConfigVersion.cmake @ONLY)
|
| 419 |
install (FILES |
| 420 |
${CMAKE_CURRENT_BINARY_DIR}/FFTW3${PREC_SUFFIX}Config.cmake
|
| 421 |
${CMAKE_CURRENT_BINARY_DIR}/FFTW3${PREC_SUFFIX}ConfigVersion.cmake
|
| 422 |
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/fftw3${PREC_SUFFIX}
|
| 423 |
COMPONENT Development) |
| 424 |
|
| 425 |
export (TARGETS ${fftw3_lib} NAMESPACE FFTW3:: FILE ${PROJECT_BINARY_DIR}/FFTW3LibraryDepends.cmake)
|
| 426 |
install(EXPORT FFTW3LibraryDepends |
| 427 |
NAMESPACE FFTW3:: |
| 428 |
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/fftw3${PREC_SUFFIX}
|
| 429 |
COMPONENT Development) |