From 7af748495adb656bede9bcba0fbb74ddd14029a1 Mon Sep 17 00:00:00 2001 From: maier Date: Fri, 19 Apr 2013 14:38:47 +0000 Subject: [PATCH] Revert "Revert r29332 since it leads to bad entries in common/Make.global_options." 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 | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/deal.II/cmake/config/CMakeLists.txt b/deal.II/cmake/config/CMakeLists.txt index 02780e6ed2..8522bbf9ba 100644 --- a/deal.II/cmake/config/CMakeLists.txt +++ b/deal.II/cmake/config/CMakeLists.txt @@ -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() -- 2.39.5