Salome HOME
Merge from V6_main 01/04/2013
[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(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/SalomeMacros.cmake)
21
22 INCLUDE_DIRECTORIES(
23   ${CMAKE_CURRENT_BINARY_DIR}
24 )
25 # Python modules to be installed
26 SET(mypkgpython_PYTHON
27   __init__.py
28   selectvars.py
29   genericdialog.py
30   mytestdialog.py
31   helper.py
32 )
33 SALOME_INSTALL_SCRIPTS("${mypkgpython_PYTHON}" ${GUI_salomepythondir}/salome/gui)
34
35 SET(PYUIC_FILES
36   SelectVarsDialog_ui.py
37   genericdialog_ui.py
38   mytestdialog_ui.py
39 )
40
41 FOREACH(output ${PYUIC_FILES})
42   STRING(REPLACE "_ui.py" ".ui" input ${output})
43   SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${input})
44   SET(output ${CMAKE_CURRENT_BINARY_DIR}/${output})
45   ADD_CUSTOM_COMMAND(
46     OUTPUT ${output}
47     COMMAND ${PYQT_PYUIC_EXECUTABLE} -o ${output} ${input}
48     MAIN_DEPENDENCY ${input}
49   )
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 ${GUI_salomepythondir}/salome/gui)
56 ENDFOREACH(output ${PYUIC_FILES})