]> SALOME platform Git repositories - modules/parametric.git/blob - src/salome/parametric/gui/CMakeLists.txt
Salome HOME
Compile Python files on installation
[modules/parametric.git] / src / salome / parametric / gui / CMakeLists.txt
1 # Copyright (C) 2012 EDF
2 #
3 # This file is part of SALOME PARAMETRIC module.
4 #
5 # SALOME PARAMETRIC module is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Lesser General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # SALOME PARAMETRIC module is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU Lesser General Public License for more details.
14 #
15 # You should have received a copy of the GNU Lesser General Public License
16 # along with SALOME PARAMETRIC module.  If not, see <http://www.gnu.org/licenses/>.
17
18 SET(PYTHON_FILES
19   __init__.py
20   definevalues.py
21   execparams.py
22   genjob.py
23   mainpanel.py
24   selectvars.py
25   wizard.py
26 )
27 SET(PYUIC_FILES wizard_ui.py varrange_ui.py execparams_ui.py genjob_ui.py definevalues_ui.py)
28 SET(INSTALL_DIR ${PYTHONDIR}/salome/parametric/gui)
29
30 FOREACH(OUTPUT ${PYUIC_FILES})
31   STRING(REPLACE "_ui.py" ".ui" INPUT ${OUTPUT})
32   SET(INPUT ${CMAKE_CURRENT_SOURCE_DIR}/${INPUT})
33   SET(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT})
34   ADD_CUSTOM_COMMAND(OUTPUT ${OUTPUT}
35                      COMMAND ${PYQT_PYUIC_EXECUTABLE} -o ${OUTPUT} ${INPUT}
36                      MAIN_DEPENDENCY ${INPUT}
37                     )
38   SET(PYTHON_FILES ${PYTHON_FILES} ${OUTPUT})
39 ENDFOREACH(OUTPUT ${PYUIC_FILES})
40
41 ADD_CUSTOM_TARGET(BUILD_PY_UI_FILES ALL DEPENDS ${PYUIC_FILES})
42
43 INSTALL_AND_COMPILE_PYTHON_FILE("${PYTHON_FILES}" ${INSTALL_DIR})