Package: magics++ / 4.5.3-1

escape-path-in-cmake.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Index: magics++-4.5.0/cmake/pkg-config.cmake.in
===================================================================
--- magics++-4.5.0.orig/cmake/pkg-config.cmake.in
+++ magics++-4.5.0/cmake/pkg-config.cmake.in
@@ -2,8 +2,11 @@
 file(READ @CMAKE_CURRENT_BINARY_DIR@/@_PAR_FILENAME@.tmp _content)
 
 string(REPLACE "@CMAKE_BINARY_DIR@/lib" "\${libdir}" _content "${_content}")
+string(REPLACE "++" "\\+\\+" libdir_escaped  "@CMAKE_BINARY_DIR@/lib")
+string(REGEX REPLACE "${libdir_escaped}" "\${libdir}" _content "${_content}")
 if(NOT "@INSTALL_LIB_DIR@" STREQUAL "lib")
   string(REPLACE "@CMAKE_BINARY_DIR@/@INSTALL_LIB_DIR@" "\${libdir}" _content "${_content}")
+  string(REGEX REPLACE "@CMAKE_INSTALL_PREFIX@/@INSTALL_LIB_DIR@" "\${libdir_escaped}" _content "${_content}")
 endif()
 string(REPLACE "@CMAKE_INSTALL_PREFIX@/@INSTALL_LIB_DIR@" "\${libdir}" _content "${_content}")