Salome HOME
Merge Qt5 porting.
[modules/gui.git] / src / GUI_PY / CMakeLists.txt
index d67ee9ad0f5880cd056af2706b0702a23d2cbdc9..ff4ebe3bf155b2389e3f6fc6e91405540c06ea2e 100755 (executable)
@@ -1,9 +1,9 @@
-# Copyright (C) 2012-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 # License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
 #
 # This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-INCLUDE_DIRECTORIES(
-  ${CMAKE_CURRENT_BINARY_DIR}
+INCLUDE(UsePyQt)
+
+# --- resources ---
+
+# uic files / to be processed by pyuic
+SET(_pyuic_files
+  SelectVarsDialog.ui
+  genericdialog.ui
+  mytestdialog.ui
 )
-# Python modules to be installed
-SET(mypkgpython_PYTHON
+
+# --- scripts ---
+
+# scripts / pyuic wrappings
+PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files})
+
+# scripts / static
+SET(_other_SCRIPTS 
   __init__.py
-  selectvars.py
   genericdialog.py
-  mytestdialog.py
   helper.py
+  mytestdialog.py
+  selectvars.py
+  dockwidgets.py
 )
-SALOME_INSTALL_SCRIPTS("${mypkgpython_PYTHON}" ${SALOME_INSTALL_PYTHON}/salome/gui)
-
-SET(PYUIC_FILES
-  SelectVarsDialog_ui.py
-  genericdialog_ui.py
-  mytestdialog_ui.py
+SET(_bin_SCRIPTS
+  test_dockwidgets.py
 )
 
-FOREACH(output ${PYUIC_FILES})
-  STRING(REPLACE "_ui.py" ".ui" input ${output})
-  SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${input})
-  SET(output ${CMAKE_CURRENT_BINARY_DIR}/${output})
-  ADD_CUSTOM_COMMAND(
-    OUTPUT ${output}
-    COMMAND ${PYQT_PYUIC_EXECUTABLE} -o ${output} ${input}
-    MAIN_DEPENDENCY ${input}
-  )
-  #${PYQT_PYUIC_EXECUTABLE}
-ENDFOREACH(output ${PYUIC_FILES})
-
-ADD_CUSTOM_TARGET(BUILD_PY_UI_FILES ALL DEPENDS ${PYUIC_FILES})
-
-FOREACH(output ${PYUIC_FILES})
-  INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${output} DESTINATION ${SALOME_INSTALL_PYTHON}/salome/gui)
-ENDFOREACH(output ${PYUIC_FILES})
+# scripts / to install
+
+SET(_all_SCRIPTS ${_other_SCRIPTS} ${_pyuic_SCRIPTS})
+
+# --- rules ---
+
+SALOME_INSTALL_SCRIPTS("${_all_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/gui)
+SALOME_INSTALL_SCRIPTS("${_bin_SCRIPTS}" ${SALOME_INSTALL_SCRIPT_DATA})