summaryrefslogtreecommitdiff
path: root/CMake/Translations.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/Translations.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/Translations.cmake')
-rw-r--r--CMake/Translations.cmake16
1 files changed, 2 insertions, 14 deletions
diff --git a/CMake/Translations.cmake b/CMake/Translations.cmake
index 7bdcab6ab..509e4e378 100644
--- a/CMake/Translations.cmake
+++ b/CMake/Translations.cmake
@@ -21,13 +21,7 @@ function(apt_add_translation_domain)
--msgid-bugs-address=${PACKAGE_MAIL}
)
foreach(source ${NLS_SCRIPTS})
- string(SUBSTRING ${source} 0 1 init_char)
- string(COMPARE EQUAL ${init_char} "/" is_absolute)
- if (${is_absolute})
- set(file "${source}")
- else()
- set(file "${CMAKE_CURRENT_SOURCE_DIR}/${source}")
- endif()
+ path_join(file "${CMAKE_CURRENT_SOURCE_DIR}" "${source}")
file(RELATIVE_PATH relfile ${PROJECT_SOURCE_DIR} ${file})
list(APPEND scripts ${relfile})
list(APPEND abs_scripts ${file})
@@ -36,13 +30,7 @@ function(apt_add_translation_domain)
get_target_property(source_dir ${target} SOURCE_DIR)
get_target_property(sources ${target} SOURCES)
foreach(source ${sources})
- string(SUBSTRING ${source} 0 1 init_char)
- string(COMPARE EQUAL ${init_char} "/" is_absolute)
- if (${is_absolute})
- set(file "${source}")
- else()
- set(file "${source_dir}/${source}")
- endif()
+ path_join(file "${source_dir}" "${source}")
file(RELATIVE_PATH relfile ${PROJECT_SOURCE_DIR} ${file})
set(files ${files} ${relfile})
set(abs_files ${abs_files} ${file})