Skip to content

Commit ac2ad83

Browse files
committed
Minor CMake improvements
* Update minimum version to 3.1 for CMP0054 new behaviour * Use stricter PRECISION regex matching * Use imported target Threads::Threads instead of CMAKE_THREAD_LIBS_INIT
1 parent 6b423d9 commit ac2ad83

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required (VERSION 3.0)
1+
cmake_minimum_required (VERSION 3.1)
22

33
if (NOT DEFINED CMAKE_BUILD_TYPE)
44
set (CMAKE_BUILD_TYPE Release CACHE STRING "Build type")
@@ -269,7 +269,7 @@ if (BUILD_SHARED_LIBS)
269269
endif ()
270270

271271
function (add_fftw_library PRECISION)
272-
if (PRECISION MATCHES "SINGLE|LDOUBLE|QUAD")
272+
if (PRECISION MATCHES "^(SINGLE|LDOUBLE|QUAD)$")
273273
set (FFTW_${PRECISION} TRUE)
274274
set (BENCHFFT_${PRECISION} TRUE)
275275
if (PRECISION STREQUAL SINGLE)
@@ -313,11 +313,11 @@ function (add_fftw_library PRECISION)
313313

314314
if (ENABLE_THREADS AND Threads_FOUND)
315315
if (WITH_COMBINED_THREADS)
316-
target_link_libraries (${fftw3_lib} ${CMAKE_THREAD_LIBS_INIT})
316+
target_link_libraries (${fftw3_lib} Threads::Threads)
317317
else ()
318318
add_library (${fftw3_lib}_threads ${fftw_threads_SOURCE})
319319
target_link_libraries (${fftw3_lib}_threads ${fftw3_lib})
320-
target_link_libraries (${fftw3_lib}_threads ${CMAKE_THREAD_LIBS_INIT})
320+
target_link_libraries (${fftw3_lib}_threads Threads::Threads)
321321
list (APPEND subtargets ${fftw3_lib}_threads)
322322
endif ()
323323
endif ()

0 commit comments

Comments
 (0)