From: ageay Date: Thu, 22 Aug 2013 07:57:07 +0000 (+0000) Subject: Update with KERNEL X-Git-Tag: B4AnonymousThrow~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2cbf00572b2e668618bc9f4ebdac64a525985258;p=modules%2Fmed.git Update with KERNEL --- diff --git a/adm_local_without_kernel/cmake_files/SalomeMacros.cmake b/adm_local_without_kernel/cmake_files/SalomeMacros.cmake index d26725b51..be1631cc9 100755 --- a/adm_local_without_kernel/cmake_files/SalomeMacros.cmake +++ b/adm_local_without_kernel/cmake_files/SalomeMacros.cmake @@ -111,14 +111,19 @@ MACRO(SALOME_INSTALL_SCRIPTS file_list path) ENDIF(NOT SALOME_INSTALL_SCRIPTS_DEF_PERMS) FOREACH(file ${file_list}) SET(PREFIX "") - IF(SALOME_INSTALL_SCRIPTS_WORKING_DIRECTORY) - SET(PREFIX "${SALOME_INSTALL_SCRIPTS_WORKING_DIRECTORY}/") - ENDIF(SALOME_INSTALL_SCRIPTS_WORKING_DIRECTORY) + IF(IS_ABSOLUTE ${file}) + GET_FILENAME_COMPONENT(file_name ${file} NAME) + ELSE() + SET(file_name ${file}) + IF(SALOME_INSTALL_SCRIPTS_WORKING_DIRECTORY) + SET(PREFIX "${SALOME_INSTALL_SCRIPTS_WORKING_DIRECTORY}/") + ENDIF(SALOME_INSTALL_SCRIPTS_WORKING_DIRECTORY) + ENDIF(IS_ABSOLUTE ${file}) INSTALL(FILES ${PREFIX}${file} DESTINATION ${path} PERMISSIONS ${PERMS}) GET_FILENAME_COMPONENT(ext ${file} EXT) IF(ext STREQUAL .py) - INSTALL(CODE "MESSAGE(STATUS \"py compiling ${CMAKE_INSTALL_PREFIX}/${path}/${file}\")") - INSTALL(CODE "SET(CMD \"import py_compile ; py_compile.compile('${CMAKE_INSTALL_PREFIX}/${path}/${file}')\")") + INSTALL(CODE "MESSAGE(STATUS \"py compiling ${CMAKE_INSTALL_PREFIX}/${path}/${file_name}\")") + INSTALL(CODE "SET(CMD \"import py_compile ; py_compile.compile('${CMAKE_INSTALL_PREFIX}/${path}/${file_name}')\")") INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c \"\${CMD}\")") INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -O -c \"\${CMD}\")") ENDIF(ext STREQUAL .py) @@ -151,16 +156,26 @@ ENDMACRO(INSTALL_AND_COMPILE_PYTHON_FILE PYFILE2COMPINST PYFILELOC) # USAGE: SALOME_CONFIGURE_FILE(in_file out_file [INSTALL dir]) # # ARGUMENTS: -# in_file: IN : input file with full paths. -# out_file: IN : output file with full paths. +# in_file: IN : input file (if relative path is given, full file path is computed from current source dir). +# out_file: IN : output file (if relative path is given, full file path is computed from current build dir). # If INSTALL is specified, then 'out_file' will be installed to the 'dir' directory. #---------------------------------------------------------------------------- MACRO(SALOME_CONFIGURE_FILE IN_FILE OUT_FILE) - MESSAGE(STATUS "Creation of ${OUT_FILE}") - CONFIGURE_FILE(${IN_FILE} ${OUT_FILE} @ONLY) + IF(IS_ABSOLUTE ${IN_FILE}) + SET(_in_file ${IN_FILE}) + ELSE() + SET(_in_file ${CMAKE_CURRENT_SOURCE_DIR}/${IN_FILE}) + ENDIF() + IF(IS_ABSOLUTE ${OUT_FILE}) + SET(_out_file ${OUT_FILE}) + ELSE() + SET(_out_file ${CMAKE_CURRENT_BINARY_DIR}/${OUT_FILE}) + ENDIF() + MESSAGE(STATUS "Creation of ${_out_file}") + CONFIGURE_FILE(${_in_file} ${_out_file} @ONLY) PARSE_ARGUMENTS(SALOME_CONFIGURE_FILE "INSTALL" "" ${ARGN}) IF(SALOME_CONFIGURE_FILE_INSTALL) - INSTALL(FILES ${OUT_FILE} DESTINATION ${SALOME_CONFIGURE_FILE_INSTALL}) + INSTALL(FILES ${_out_file} DESTINATION ${SALOME_CONFIGURE_FILE_INSTALL}) ENDIF(SALOME_CONFIGURE_FILE_INSTALL) ENDMACRO(SALOME_CONFIGURE_FILE)