#----------------------------------------------------------------------------
# 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.
#
# 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)
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)
####################################################################
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})
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)
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})