summaryrefslogtreecommitdiff
path: root/CMake/Misc.cmake
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2016-08-08 21:53:05 +0200
committerJulian Andres Klode <jak@debian.org>2016-08-10 16:17:18 +0200
commit0d04a4987feb9ec45ddfa03270e20f76cae02a84 (patch)
tree7a239b26f68f3f1cf7e9a98cc1a8c30b8e584132 /CMake/Misc.cmake
parent8c1dbbef35bea4082eacfe4e626e7726b9e84349 (diff)
CMake: Misc: Extract command path_join() from Translations
This abstracts the joining of paths a bit better than having basically the same code twice in the Translations module. Gbp-Dch: ignore
Diffstat (limited to 'CMake/Misc.cmake')
-rw-r--r--CMake/Misc.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/CMake/Misc.cmake b/CMake/Misc.cmake
index 3329fc20f..79587b068 100644
--- a/CMake/Misc.cmake
+++ b/CMake/Misc.cmake
@@ -77,3 +77,12 @@ function(add_version_script target)
target_link_libraries(${target} PRIVATE -Wl,-version-script="${script}")
add_dependencies(${target} ${target}-versionscript)
endfunction()
+
+function(path_join out path1 path2)
+ string(SUBSTRING ${path2} 0 1 init_char)
+ if ("${init_char}" STREQUAL "/")
+ set(${out} "${path2}" PARENT_SCOPE)
+ else()
+ set(${out} "${path1}/${path2}" PARENT_SCOPE)
+ endif()
+endfunction()