]> SALOME platform Git repositories - tools/configuration.git/commitdiff
Salome HOME
0023473: [CEA 2163] SMESH compilation failure with a PyCompileError V8_4_0rc1
authorvsr <vsr@opencascade.com>
Thu, 12 Oct 2017 06:57:57 +0000 (09:57 +0300)
committervsr <vsr@opencascade.com>
Thu, 12 Oct 2017 06:57:57 +0000 (09:57 +0300)
- Improve SALOME_INSTALL_SCRIPTS and PYQT_WRAP_SIP macros to return name of created target

cmake/SalomeMacros.cmake
cmake/UsePyQt.cmake

index 1db407c1867b676de00d2823ee5a6282b481f99e..cea90a777f62985578fd8295ab2fb324b3a3a130 100644 (file)
@@ -93,7 +93,7 @@ ENDMACRO(PARSE_ARGUMENTS)
 #----------------------------------------------------------------------------
 # SALOME_INSTALL_SCRIPTS is a macro useful for installing scripts.
 #
-# USAGE: SALOME_INSTALL_SCRIPTS(file_list path [WORKING_DIRECTORY dir] [DEF_PERMS])
+# USAGE: SALOME_INSTALL_SCRIPTS(file_list path [WORKING_DIRECTORY dir] [DEF_PERMS] [TARGET_NAME name])
 #
 # ARGUMENTS:
 # file_list: IN : list of files to be installed. This list should be quoted.
@@ -101,10 +101,14 @@ ENDMACRO(PARSE_ARGUMENTS)
 # 
 # By default files to be installed as executable scripts.
 # If DEF_PERMS option is provided, than permissions for installed files are
-# only OWNER_WRITE, OWNER_READ, GROUP_READ, and WORLD_READ. 
+# only OWNER_WRITE, OWNER_READ, GROUP_READ, and WORLD_READ.
+# WORKING_DIRECTORY option may be used to specify the relative or absolute
+# path to the directory containing source files listed in file_list argument.
+# If TARGET_NAME option is specified, the name of the target being created
+# with this macro is returned via the given variable.
 #----------------------------------------------------------------------------
 MACRO(SALOME_INSTALL_SCRIPTS file_list path)
-  PARSE_ARGUMENTS(SALOME_INSTALL_SCRIPTS "WORKING_DIRECTORY" "DEF_PERMS" ${ARGN})
+  PARSE_ARGUMENTS(SALOME_INSTALL_SCRIPTS "WORKING_DIRECTORY;TARGET_NAME" "DEF_PERMS" ${ARGN})
   SET(PERMS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
   IF(NOT SALOME_INSTALL_SCRIPTS_DEF_PERMS)
     SET(PERMS ${PERMS} OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
@@ -168,7 +172,11 @@ MACRO(SALOME_INSTALL_SCRIPTS file_list path)
      WHILE(TARGET "PYCOMPILE${unique_name}_${_cnt}")
        MATH(EXPR _cnt ${_cnt}+1)
      ENDWHILE()
-     ADD_CUSTOM_TARGET("PYCOMPILE${unique_name}_${_cnt}" ALL DEPENDS ${_all_pyc} ${_all_pyo})
+     SET(_target_name "PYCOMPILE${unique_name}_${_cnt}")
+     ADD_CUSTOM_TARGET(${_target_name} ALL DEPENDS ${_all_pyc} ${_all_pyo})
+     IF(SALOME_INSTALL_SCRIPTS_TARGET_NAME)
+       SET(${SALOME_INSTALL_SCRIPTS_TARGET_NAME} ${_target_name})
+     ENDIF(SALOME_INSTALL_SCRIPTS_TARGET_NAME)
   ENDIF()
 ENDMACRO(SALOME_INSTALL_SCRIPTS)
 
index 587aef25a6bb9d72a187ce0cbeccc431968a6c1b..42a528775b72bfc3191e1247cb17fbace0211493 100644 (file)
@@ -66,9 +66,11 @@ ENDFUNCTION()
 ####################################################################
 MACRO(PYQT_WRAP_UIC outfiles)
 
+ PARSE_ARGUMENTS(PYQT_WRAP_UIC "TARGET_NAME" "" ${ARGN})
+
  IF(NOT WIN32)
 
-  FOREACH(_input ${ARGN})
+  FOREACH(_input ${PYQT_WRAP_UIC_DEFAULT_ARGS})
     GET_FILENAME_COMPONENT(_input_name ${_input} NAME)
     STRING(REPLACE ".ui" "_ui.py" _input_name ${_input_name})
     SET(_output ${CMAKE_CURRENT_BINARY_DIR}/${_input_name})
@@ -81,6 +83,9 @@ MACRO(PYQT_WRAP_UIC outfiles)
   ENDFOREACH()
   _PYQT_WRAP_GET_UNIQUE_TARGET_NAME(BUILD_UI_PY_FILES _uniqueTargetName)
   ADD_CUSTOM_TARGET(${_uniqueTargetName} ALL DEPENDS ${${outfiles}})
+  IF(PYQT_WRAP_UIC_TARGET_NAME)
+    SET(${PYQT_WRAP_UIC_TARGET_NAME} ${_uniqueTargetName})
+  ENDIF(PYQT_WRAP_UIC_TARGET_NAME)
 
  ELSE(NOT WIN32)
 
@@ -95,8 +100,11 @@ MACRO(PYQT_WRAP_UIC outfiles)
   SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
   _PYQT_WRAP_GET_UNIQUE_TARGET_NAME(BUILD_UI_PY_FILES _uniqueTargetName)
   ADD_CUSTOM_TARGET(${_uniqueTargetName} ALL)
+  IF(PYQT_WRAP_UIC_TARGET_NAME)
+    SET(${PYQT_WRAP_UIC_TARGET_NAME} ${_uniqueTargetName})
+  ENDIF(PYQT_WRAP_UIC_TARGET_NAME)
   SET_TARGET_PROPERTIES(${_uniqueTargetName} PROPERTIES FOLDER PYQT_WRAP_UIC_TARGETS)
-  FOREACH(_input ${ARGN})
+  FOREACH(_input ${PYQT_WRAP_UIC_DEFAULT_ARGS})
     GET_FILENAME_COMPONENT(_input_name ${_input} NAME)
     STRING(REPLACE ".ui" "_ui.py" _input_name ${_input_name})
     SET(_output ${CMAKE_CURRENT_BINARY_DIR}/${_input_name})