1 # Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 INSTALL(CODE "MACRO(QT4_COMPILE_TS_ON_INSTALL MYLRELEASE MYTSFILE MYFULLDIR MYOUTQMFILE)
21 FILE(MAKE_DIRECTORY \${MYFULLDIR})
22 MESSAGE(STATUS \"Compiling \${MYTSFILE}\")
23 EXECUTE_PROCESS(COMMAND \${MYLRELEASE} \${MYTSFILE} -qm \${MYFULLDIR}/\${MYOUTQMFILE})
24 ENDMACRO(QT4_COMPILE_TS_ON_INSTALL)")
26 # This MACRO uses the following vars
27 # - QT_LRELEASE_EXECUTABLE : (given by default by FindQT.cmake)
29 # MYTSFILES containing all ts files to be compiled.
30 # WHERETOINSTALL contains directory (relative to install_prefix) where to install files after compilation of ts files too qm.
31 MACRO(QT4_INSTALL_TS_RESOURCES MYTSFILES WHERETOINSTALL)
32 INSTALL(CODE "SET(INSTALL_TS_DIR ${WHERETOINSTALL})")
34 FOREACH(input ${MYTSFILES})
35 GET_FILENAME_COMPONENT(input2 ${input} NAME)
36 STRING(REGEX REPLACE ".ts" "" base ${input2})
37 SET(output "${base}.qm")
38 INSTALL(CODE "QT4_COMPILE_TS_ON_INSTALL( \"${QT_LRELEASE_EXECUTABLE}\" \"${CMAKE_CURRENT_SOURCE_DIR}/${input}\" \"${CMAKE_INSTALL_PREFIX}/\${INSTALL_TS_DIR}\" ${output})")
39 ENDFOREACH(input ${MYIDLFILES})
40 ENDMACRO(QT4_INSTALL_TS_RESOURCES)