From 428c5d165bdcea31dba6576bdeaaf7e1765fef77 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christoph=20Gr=C3=BCninger?= <gruenich@dune-project.org>
Date: Thu, 8 Aug 2013 17:54:54 +0200
Subject: [PATCH] [CMake] Remove parentheses from dune-*.pc.

This fixes FS#1324.
Thanks to Arne Morten Kvarving for the patch.
---
 cmake/modules/DunePkgConfig.cmake | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/cmake/modules/DunePkgConfig.cmake b/cmake/modules/DunePkgConfig.cmake
index 20197e932..0b6e3fa87 100644
--- a/cmake/modules/DunePkgConfig.cmake
+++ b/cmake/modules/DunePkgConfig.cmake
@@ -15,7 +15,18 @@ set(VERSION ${DUNE_MOD_VERSION})
 set(CC ${CMAKE_C_COMPILER})
 set(CXX "${CMAKE_CXX_COMPILER} ${CXX_STD11_FLAGS}")
 
-set(REQUIRES ${DUNE_DEPENDS})
+if(DUNE_DEPENDS)
+  foreach(_DUNE_DEPEND ${DUNE_DEPENDS})
+    string(REGEX REPLACE "\\(" "" REQF1 ${_DUNE_DEPEND})
+    string(REGEX REPLACE "\\)" "" LR ${REQF1})
+    if(REQUIRES)
+      set(REQUIRES "${REQUIRES} ${LR}")
+    else()
+      set(REQUIRES ${LR})
+    endif(REQUIRES)
+  endforeach(_DUNE_DEPEND ${DUNE_DEPENDS})
+endif(DUNE_DEPENDS)
+
 #create pkg-config file
 configure_file(
   ${PROJECT_SOURCE_DIR}/${DUNE_MOD_NAME}.pc.in
@@ -24,7 +35,7 @@ configure_file(
 )
 
 # install pkgconfig file
-if(PKG_CONFIG_FOUND )
+if(PKG_CONFIG_FOUND)
   install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DUNE_MOD_NAME}.pc
     DESTINATION lib/pkgconfig)
 endif(PKG_CONFIG_FOUND)
-- 
GitLab