]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fixed cmake 3.16.0 incompatibility. 9117/head
authorMarc Fehling <marc.fehling@gmx.net>
Sat, 30 Nov 2019 23:51:16 +0000 (00:51 +0100)
committerMarc Fehling <marc.fehling@gmx.net>
Mon, 2 Dec 2019 17:12:31 +0000 (18:12 +0100)
cmake/configure/configure_1_threads.cmake

index b4de2cc2ccfb6d6b8fa4be545fb3141abce34209..b039497a131dfea88b5cc7b4d21667487b1b24dd 100644 (file)
@@ -38,6 +38,16 @@ MACRO(SETUP_THREADING)
 
     RESET_CMAKE_REQUIRED()
 
+    #
+    # The FindThreads macro returned a linker option instead of the actual
+    # library name in earlier versions. We still require the linker option,
+    # so we fix the corresponding variable.
+    #  - See: https://gitlab.kitware.com/cmake/cmake/issues/19747
+    #
+    IF(CMAKE_THREAD_LIBS_INIT AND NOT "${CMAKE_THREAD_LIBS_INIT}" MATCHES "^-l")
+      STRING(PREPEND CMAKE_THREAD_LIBS_INIT "-l")
+    ENDIF()
+
   ELSE()
 
     #

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.