summaryrefslogtreecommitdiffstats
path: root/Modules/FindGettext.cmake
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2011-11-15 17:49:47 (GMT)
committerAlex Neundorf <neundorf@kde.org>2011-11-15 17:49:47 (GMT)
commite48fcfffa36ca34703a4c366cb96593373234faa (patch)
tree62bdf4869be24a9862a6f55d34f38a5ba13760fa /Modules/FindGettext.cmake
parentecb4459e31a0defec084ca0a02e0450da718afdb (diff)
downloadCMake-e48fcfffa36ca34703a4c366cb96593373234faa.zip
CMake-e48fcfffa36ca34703a4c366cb96593373234faa.tar.gz
CMake-e48fcfffa36ca34703a4c366cb96593373234faa.tar.bz2
-make GETTEXT_PROCESS_PO_FILES() work with files with multiple dots
Patch by Albert Astals Cid. E.g. plasma_package_org.kde.activityswitcher.po will now be installed correctly as plasma_package_org.kde.activityswitcher.mo, and not as plasma_package_org.mo. This is kind-of related to #12282 Alex
Diffstat (limited to 'Modules/FindGettext.cmake')
-rw-r--r--Modules/FindGettext.cmake3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/FindGettext.cmake b/Modules/FindGettext.cmake
index 7c3a261..ffe3f26 100644
--- a/Modules/FindGettext.cmake
+++ b/Modules/FindGettext.cmake
@@ -134,7 +134,8 @@ FUNCTION(GETTEXT_PROCESS_PO_FILES _lang)
CMAKE_PARSE_ARGUMENTS(_parsedArguments "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
FOREACH(_current_PO_FILE ${_parsedArguments_PO_FILES})
- GET_FILENAME_COMPONENT(_basename ${_current_PO_FILE} NAME_WE)
+ GET_FILENAME_COMPONENT(_name ${_current_PO_FILE} NAME)
+ STRING(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _basename ${_name})
SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo)
ADD_CUSTOM_COMMAND(OUTPUT ${_gmoFile}
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_current_PO_FILE}