]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Revert "Revert r29332 since it leads to bad entries in common/Make.global_options."
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 19 Apr 2013 14:38:47 +0000 (14:38 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 19 Apr 2013 14:38:47 +0000 (14:38 +0000)
And provide a fix for the underlying problem

git-svn-id: https://svn.dealii.org/trunk@29343 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/config/CMakeLists.txt

index 02780e6ed275df03ad692c4c7e14bad16a2d8559..8522bbf9ba769678d5c0852813ed93657eefc2f4 100644 (file)
@@ -173,7 +173,7 @@ IF(DEAL_II_COMPONENT_COMPAT_FILES)
         ${DEAL_II_EXTERNAL_LIBRARIES}
         ${DEAL_II_EXTERNAL_LIBRARIES_${build}}
         )
-      IF(_lib MATCHES "^/")
+      IF(_lib MATCHES "^\\s*/")
         LIST(APPEND _libs "${_lib}")
       ENDIF()
     ENDFOREACH()
@@ -189,13 +189,30 @@ IF(DEAL_II_COMPONENT_COMPAT_FILES)
         ${DEAL_II_EXTERNAL_LIBRARIES}
         ${DEAL_II_EXTERNAL_LIBRARIES_${build}}
         )
-      LIST(APPEND MAKEFILE_LIBS_${build} ${_lib})
+
       #
-      # Extract library paths where possible:
+      # Strip leading and trailing whitespace
       #
+      STRING(STRIP "${_lib}" _lib)
+
       IF(_lib MATCHES "^(/|\\$\\(D\\))")
+        # Full path: /path/to/libfoo.so:
+
+        # Extract library paths:
         GET_FILENAME_COMPONENT(_path ${_lib} PATH)
         LIST(APPEND _paths ${_path})
+
+        LIST(APPEND MAKEFILE_LIBS_${build} ${_lib})
+
+      ELSEIF(_lib MATCHES "^-l")
+        # Library is of the form "-lfoo":
+        LIST(APPEND MAKEFILE_LIBS_${build} ${_lib})
+
+      ELSEIF(NOT "${_lib}" STREQUAL "")
+        # Well in this case we just assume that we have to append an "-l"
+        # I'm sorry, but this won't get libfoo.so right, ...
+        LIST(APPEND MAKEFILE_LIBS_${build} "-l${_lib}")
+
       ENDIF()
     ENDFOREACH()
 

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.