Salome HOME
CMake: wrote a safer command for the PyQt4 executable
[modules/gui.git] / src / GUI_PY / CMakeLists.txt
1 # Copyright (C) 2012-2013  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
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.
7 #
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.
12 #
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
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 INCLUDE_DIRECTORIES(
21   ${CMAKE_CURRENT_BINARY_DIR}
22 )
23 # Python modules to be installed
24 SET(mypkgpython_PYTHON
25   __init__.py
26   selectvars.py
27   genericdialog.py
28   mytestdialog.py
29   helper.py
30 )
31 SALOME_INSTALL_SCRIPTS("${mypkgpython_PYTHON}" ${SALOME_INSTALL_PYTHON}/salome/gui)
32
33 SET(PYUIC_FILES
34   SelectVarsDialog_ui.py
35   genericdialog_ui.py
36   mytestdialog_ui.py
37 )
38
39 FOREACH(output ${PYUIC_FILES})
40   STRING(REPLACE "_ui.py" ".ui" input ${output})
41   SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${input})
42   SET(output ${CMAKE_CURRENT_BINARY_DIR}/${output})
43   ADD_CUSTOM_COMMAND(
44     OUTPUT ${output}
45     COMMAND ${PYQT_PYUIC_EXECUTABLE} -o ${output} ${input}
46     MAIN_DEPENDENCY ${input}
47     VERBATIM
48   )
49   #${PYQT_PYUIC_EXECUTABLE}
50 ENDFOREACH(output ${PYUIC_FILES})
51
52 ADD_CUSTOM_TARGET(BUILD_PY_UI_FILES ALL DEPENDS ${PYUIC_FILES})
53
54 FOREACH(output ${PYUIC_FILES})
55   INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${output} DESTINATION ${SALOME_INSTALL_PYTHON}/salome/gui)
56 ENDFOREACH(output ${PYUIC_FILES})