File: gettextizeui.cmake

package info (click to toggle)
gimagereader 3.4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,148 kB
  • sloc: cpp: 29,313; xml: 376; sh: 282; python: 70; makefile: 42
file content (12 lines) | stat: -rw-r--r-- 538 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
# Function to replace QApplication::translate with gettext() in ui headers
# 3: argv0 = cmake, argv1 = -P, argv2 = gettextizeui.cmake
FOREACH(i RANGE 3 ${CMAKE_ARGC})
	SET(form_header "${CMAKE_ARGV${i}}")
	IF(NOT "${form_header}" STREQUAL "")
		MESSAGE(STATUS "Gettextizing ${form_header}")
		FILE(READ ${form_header} _text)
		STRING(REGEX REPLACE "Q(Core)?Application::translate\\(\"[^\"]+\", \"((\\\\.|[^\\\"])*)\", [^\\)]+\\)" "gettext(\"\\2\")" _text_out "${_text}")
		FILE(WRITE ${form_header} "${_text_out}")
	ENDIF()
ENDFOREACH()