fix: type of liba.version in Python2
[liba.git] / cmake / core / string.cmake
blob5046d46d0e69cd84a514721b7808708c17b9fbee
1 function(string_remove var)
2   foreach(arg ${ARGN})
3     string(REPLACE "${arg} " "" ${var} "${${var}}")
4     string(REPLACE "${arg}" "" ${var} "${${var}}")
5   endforeach()
6   set(${var} "${${var}}" PARENT_SCOPE)
7 endfunction()
9 function(string_prefix var)
10   foreach(arg ${ARGN})
11     string(FIND "${${var}}" "${arg}" index)
12     if(${index} EQUAL -1)
13       string(STRIP "${arg} ${${var}}" ${var})
14     endif()
15   endforeach()
16   set(${var} "${${var}}" PARENT_SCOPE)
17 endfunction()
19 function(string_append var)
20   foreach(arg ${ARGN})
21     string(FIND "${${var}}" "${arg}" index)
22     if(${index} EQUAL -1)
23       string(STRIP "${${var}} ${arg}" ${var})
24     endif()
25   endforeach()
26   set(${var} "${${var}}" PARENT_SCOPE)
27 endfunction()