]> SALOME platform Git repositories - modules/med.git/commitdiff
Salome HOME
Update with KERNEL
authorageay <ageay>
Thu, 22 Aug 2013 07:57:07 +0000 (07:57 +0000)
committerageay <ageay>
Thu, 22 Aug 2013 07:57:07 +0000 (07:57 +0000)
adm_local_without_kernel/cmake_files/SalomeMacros.cmake

index d26725b51b19b92d0da4fb5755f7af59a0973197..be1631cc970211624b9c057de27652da3efd0877 100755 (executable)
@@ -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)