From: vsr Date: Thu, 12 Oct 2017 06:57:57 +0000 (+0300) Subject: 0023473: [CEA 2163] SMESH compilation failure with a PyCompileError X-Git-Tag: V8_4_0rc1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f61d1c478c5c37050c165ccefbc949aa0bd95dd8;p=tools%2Fconfiguration.git 0023473: [CEA 2163] SMESH compilation failure with a PyCompileError - Improve SALOME_INSTALL_SCRIPTS and PYQT_WRAP_SIP macros to return name of created target --- diff --git a/cmake/SalomeMacros.cmake b/cmake/SalomeMacros.cmake index 1db407c..cea90a7 100644 --- a/cmake/SalomeMacros.cmake +++ b/cmake/SalomeMacros.cmake @@ -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) diff --git a/cmake/UsePyQt.cmake b/cmake/UsePyQt.cmake index 587aef2..42a5287 100644 --- a/cmake/UsePyQt.cmake +++ b/cmake/UsePyQt.cmake @@ -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})