]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
0023473: [CEA 2163] SMESH compilation failure with a PyCompileError V8_4_0rc1
authorvsr <vsr@opencascade.com>
Thu, 12 Oct 2017 09:48:54 +0000 (12:48 +0300)
committervsr <vsr@opencascade.com>
Mon, 16 Oct 2017 15:16:32 +0000 (18:16 +0300)
- Add direct dependencies between targets generated by PYQT_WRAP_UIC and SALOME_INSTALL_SCRIPTS macros to avoid races problem

src/Tools/MGCleanerPlug/CMakeLists.txt
src/Tools/MeshCut/CMakeLists.txt
src/Tools/Verima/Gui/CMakeLists.txt
src/Tools/YamsPlug/CMakeLists.txt
src/Tools/ZCracksPlug/CMakeLists.txt
src/Tools/blocFissure/ihm/CMakeLists.txt
src/Tools/padder/spadderpy/gui/CMakeLists.txt

index 50a2d05c94f9c374e55212421bfd2265eacfa91e..71758729d216009394bb970a784936931ccaf698 100644 (file)
 #
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+
 IF(SALOME_BUILD_DOC)
   ADD_SUBDIRECTORY(doc)
 ENDIF(SALOME_BUILD_DOC)
 
-INCLUDE(UsePyQt)
+IF(SALOME_BUILD_GUI)
+  INCLUDE(UsePyQt)
+ENDIF(SALOME_BUILD_GUI)
 
 # --- scripts ---
 
 # scripts / static
-SET(plugin_SCRIPTS
+SET(_plugin_SCRIPTS
   MGCleanerMonPlugDialog.py
   MGCleanerMonViewText.py
   MGCleanerplug_plugin.py 
 )
 
-# --- resources ---
-
-# uic files / to be processed by pyuic
-SET(_pyuic_files
-  MGCleanerPlugDialog.ui
-  MGCleanerViewText.ui
-)
-
-# scripts / pyuic wrappings
-PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files})
+IF(SALOME_BUILD_GUI)
+  # uic files / to be processed by pyuic
+  SET(_pyuic_FILES
+    MGCleanerPlugDialog.ui
+    MGCleanerViewText.ui
+  )
+  # scripts / pyuic wrappings
+  PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_FILES} TARGET_NAME _target_name_pyuic)
+ENDIF(SALOME_BUILD_GUI)
 
 # --- rules ---
 
-SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS})
+SALOME_INSTALL_SCRIPTS("${_plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS})
 
 IF(SALOME_BUILD_GUI)
-  SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS})
-ENDIF(SALOME_BUILD_GUI)
\ No newline at end of file
+  SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS} TARGET_NAME _target_name_pyuic_py)
+  # add dependency of compiled py files on uic files in order
+  # to avoid races problems when compiling in parallel
+  ADD_DEPENDENCIES(${_target_name_pyuic_py} ${_target_name_pyuic})
+ENDIF(SALOME_BUILD_GUI)
index 2125c0be1148379f53dceef605f0ff0e29f558d5..44c8cae1c4386b02a42072329183ae01a10726db 100644 (file)
@@ -38,7 +38,7 @@ SET(_link_LIBRARIES
 # --- scripts ---
 
 # scripts / static
-SET(plugin_SCRIPTS
+SET(_plugin_SCRIPTS
   meshcut_plugin.py
 )
 
@@ -61,26 +61,25 @@ SET(MeshCut_SOURCES
 )
 
 IF(SALOME_BUILD_GUI)
-  # --- resources ---
-
   # uic files / to be processed by pyuic
-  SET(_pyuic_files
+  SET(_pyuic_FILES
     MeshCutDialog.ui
   )
-
   # scripts / pyuic wrappings
-  PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files})
-
+  PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_FILES} TARGET_NAME _target_name_pyuic)
 ENDIF(SALOME_BUILD_GUI)
 
 # --- rules ---
 
-SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS})
+SALOME_INSTALL_SCRIPTS("${_plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS})
 
 ADD_EXECUTABLE(MeshCut ${MeshCut_SOURCES})
 TARGET_LINK_LIBRARIES(MeshCut ${_link_LIBRARIES})
 INSTALL(TARGETS MeshCut EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS})
 
 IF(SALOME_BUILD_GUI)
-  INSTALL(FILES ${_pyuic_SCRIPTS} DESTINATION ${SALOME_INSTALL_BINS})
+  SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_INSTALL_BINS} TARGET_NAME _target_name_pyuic_py)
+  # add dependency of compiled py files on uic files in order
+  # to avoid races problems when compiling in parallel
+  ADD_DEPENDENCIES(${_target_name_pyuic_py} ${_target_name_pyuic})
 ENDIF(SALOME_BUILD_GUI)
index 07c0275a1dedd07d5b0518c9b03f107e2527874c..1e0cf7b74784405993e97be203738784979ee901 100644 (file)
@@ -22,7 +22,7 @@ INCLUDE(UsePyQt)
 # --- scripts ---
 
 # scripts / static
-SET(plugin_SCRIPTS
+SET(_plugin_SCRIPTS
   maFenetreChoix.py
   monEditor.py
   monNomBase.py
@@ -30,10 +30,8 @@ SET(plugin_SCRIPTS
   __init__.py
 )
 
-# --- resources ---
-
 # uic files / to be processed by pyuic
-SET(_pyuic_files
+SET(_pyuic_FILES
   desFenetreChoix.ui
   desStat.ui
   myMainTotale.ui
@@ -42,12 +40,14 @@ SET(_pyuic_files
   nomBase.ui
   tousLesJobs.ui
 )
-
 # scripts / pyuic wrappings
-PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files})
+PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_FILES} TARGET_NAME _target_name_pyuic)
 
 # --- rules ---
 
-SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}/Verima/Gui)
+SALOME_INSTALL_SCRIPTS("${_plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}/Verima/Gui)
 
-SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}/Verima/Gui)
+SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS}/Verima/Gui TARGET_NAME _target_name_pyuic_py)
+# add dependency of compiled py files on uic files in order
+# to avoid races problems when compiling in parallel
+ADD_DEPENDENCIES(${_target_name_pyuic_py} ${_target_name_pyuic})
index 29e6fc99fa22a46d41adc98466990fe8a0e2b108..9ab185c11e930992daf7fb0fcdb5d5ee460ab00c 100644 (file)
@@ -21,30 +21,36 @@ IF(SALOME_BUILD_DOC)
   ADD_SUBDIRECTORY(doc)
 ENDIF(SALOME_BUILD_DOC)
 
-INCLUDE(UsePyQt)
+IF(SALOME_BUILD_GUI)
+  INCLUDE(UsePyQt)
+ENDIF(SALOME_BUILD_GUI)
 
 # --- scripts ---
 
 # scripts / static
-SET(plugin_SCRIPTS
+SET(_plugin_SCRIPTS
   monYamsPlugDialog.py
   monViewText.py
   yamsplug_plugin.py  
 )
 
-# --- resources ---
-
-# uic files / to be processed by pyuic
-SET(_pyuic_files
-  YamsPlugDialog.ui  
-  ViewText.ui
-)
-
-# scripts / pyuic wrappings
-PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files})
+IF(SALOME_BUILD_GUI)
+  # uic files / to be processed by pyuic
+  SET(_pyuic_FILES
+    YamsPlugDialog.ui  
+    ViewText.ui
+  )
+  # scripts / pyuic wrappings
+  PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_FILES} TARGET_NAME _target_name_pyuic)
+ENDIF(SALOME_BUILD_GUI)
 
 # --- rules ---
 
-SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS})
+SALOME_INSTALL_SCRIPTS("${_plugin_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS})
 
-SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS})
\ No newline at end of file
+IF(SALOME_BUILD_GUI)
+  SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_SMESH_INSTALL_PLUGINS} TARGET_NAME _target_name_pyuic_py)
+  # add dependency of compiled py files on uic files in order
+  # to avoid races problems when compiling in parallel
+  ADD_DEPENDENCIES(${_target_name_pyuic_py} ${_target_name_pyuic})
+ENDIF(SALOME_BUILD_GUI)
index 288b9d7833ca77cc1836a1053f32ea43e6d75239..2f87a5cf195fa35526b0c432df3f9e2493c26665 100644 (file)
 
 ADD_SUBDIRECTORY(casTests)
 
-INCLUDE(UsePyQt)
+IF(SALOME_BUILD_GUI)
+  INCLUDE(UsePyQt)
+ENDIF(SALOME_BUILD_GUI)
 
 # --- scripts ---
 
 # scripts / static
-SET(plugin_SCRIPTS
+SET(_plugin_SCRIPTS
   __init__.py
   ellipse.py
   genereCrack.py
@@ -38,22 +40,27 @@ SET(plugin_SCRIPTS
   Zset.py
 )
 
-SET(command_SCRIPTS
+SET(_command_SCRIPTS
   zcracksLaunch.py
 )
 
-# --- resources ---
-
-# uic files / to be processed by pyuic
-SET(_pyuic_files
-  zcracks.ui
-)
-
-# scripts / pyuic wrappings
-PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files})
+IF(SALOME_BUILD_GUI)
+  # uic files / to be processed by pyuic
+  SET(_pyuic_FILES
+    zcracks.ui
+  )
+  # scripts / pyuic wrappings
+  PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_FILES} TARGET_NAME _target_name_pyuic)
+ENDIF(SALOME_BUILD_GUI)
 
 # --- rules ---
 
-SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/Zcracks)
-SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/Zcracks)
-SALOME_INSTALL_SCRIPTS("${command_SCRIPTS}" ${SALOME_INSTALL_BINS})
+SALOME_INSTALL_SCRIPTS("${_plugin_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/Zcracks)
+SALOME_INSTALL_SCRIPTS("${_command_SCRIPTS}" ${SALOME_INSTALL_BINS})
+IF(SALOME_BUILD_GUI)
+  SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/Zcracks TARGET_NAME _target_name_pyuic_py)
+  # add dependency of compiled py files on uic files in order
+  # to avoid races problems when compiling in parallel
+  ADD_DEPENDENCIES(${_target_name_pyuic_py} ${_target_name_pyuic})
+ENDIF(SALOME_BUILD_GUI)
+
index 5ba2e6075ca790cd28984c20ab01e4f419cbf039..a561ab8168267243ddab5016f6d712989488c2c4 100644 (file)
@@ -22,7 +22,7 @@ INCLUDE(UsePyQt)
 # --- scripts ---
 
 # scripts / static
-SET(plugin_SCRIPTS
+SET(_plugin_SCRIPTS
   __init__.py
   fissureCoude_ihm.py
   fissureCoude_plugin.py
@@ -30,19 +30,19 @@ SET(plugin_SCRIPTS
   dialogFissureCoude.dic
 )
 
-# --- resources ---
-
 # uic files / to be processed by pyuic
-SET(_pyuic_files
+SET(_pyuic_FILES
   fissureCoude.ui
   fissureGenerale.ui
 )
-
 # scripts / pyuic wrappings
-PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files})
+PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_FILES} TARGET_NAME _target_name_pyuic)
 
 # --- rules ---
 
-SALOME_INSTALL_SCRIPTS("${plugin_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/blocFissure/ihm)
+SALOME_INSTALL_SCRIPTS("${_plugin_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/blocFissure/ihm)
 
-SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/blocFissure/ihm)
+SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/blocFissure/ihm TARGET_NAME _target_name_pyuic_py)
+# add dependency of compiled py files on uic files in order
+# to avoid races problems when compiling in parallel
+ADD_DEPENDENCIES(${_target_name_pyuic_py} ${_target_name_pyuic})
index 8bffecdc766415a586c836bca184b524dc36a55a..3ee6b8567a09b1fe73312b352f30ee4977d60e0b 100644 (file)
@@ -22,7 +22,7 @@ INCLUDE(UsePyQt)
 # --- scripts ---
 
 # scripts / static
-SET(py_SCRIPTS
+SET(_py_SCRIPTS
   __init__.py
   plugindialog.py
   inputdialog.py
@@ -32,7 +32,7 @@ SET(py_SCRIPTS
 # --- resources ---
 
 # uic files / to be processed by pyuic
-SET(spadderpy_DATA
+SET(_spadderpy_DATA
   parameters.png
   input.png
   select.png
@@ -46,15 +46,20 @@ SET(spadderpy_DATA
   steelbar.png
 )
 
-SET(_pyuic_files
+SET(_pyuic_FILES
   plugindialog.ui
   inputframe.ui
 )
 
 # scripts / pyuic wrappings
-PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files})
+PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_FILES} TARGET_NAME _target_name_pyuic)
 
 # --- rules ---
-SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/smesh/spadder/gui)
-SALOME_INSTALL_SCRIPTS("${py_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/smesh/spadder/gui)
-INSTALL(FILES ${spadderpy_DATA} DESTINATION ${SALOME_INSTALL_PYTHON}/salome/smesh/spadder/gui)
+SALOME_INSTALL_SCRIPTS("${_pyuic_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/smesh/spadder/gui TARGET_NAME _target_name_pyuic_py)
+# add dependency of compiled py files on uic files in order
+# to avoid races problems when compiling in parallel
+ADD_DEPENDENCIES(${_target_name_pyuic_py} ${_target_name_pyuic})
+
+SALOME_INSTALL_SCRIPTS("${_py_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/smesh/spadder/gui)
+
+INSTALL(FILES ${_spadderpy_DATA} DESTINATION ${SALOME_INSTALL_PYTHON}/salome/smesh/spadder/gui)