Salome HOME
Add rsync as a new protocol for copy.
[tools/libbatch.git] / CMakeModules / libbatchMacros.cmake
index 3741aea0c619cbe4fc11a7370882b7d61297ed0e..465782b749b020d398feada750893d9ee0db2bf4 100644 (file)
@@ -1,23 +1,23 @@
-#  Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
 #
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
 #
@@ -65,14 +65,16 @@ MACRO(LIBBATCH_FIND_ALL_LOCAL_COMMANDS)
   FIND_LOCAL_COMMAND(LIBBATCH_RCP_COMMAND rcp rcp)
   FIND_LOCAL_COMMAND(LIBBATCH_SSH_COMMAND ssh plink)
   FIND_LOCAL_COMMAND(LIBBATCH_SCP_COMMAND scp pscp)
+  FIND_LOCAL_COMMAND(LIBBATCH_RSYNC_COMMAND rsync pscp)
 
   EVAL (HAS_SH LIBBATCH_SH_COMMAND AND LIBBATCH_CP_COMMAND AND LIBBATCH_RM_COMMAND AND LIBBATCH_MKDIR_COMMAND)
   EVAL (HAS_RSH LIBBATCH_RSH_COMMAND AND LIBBATCH_RCP_COMMAND)
   EVAL (HAS_SSH LIBBATCH_SSH_COMMAND AND LIBBATCH_SCP_COMMAND)
+  EVAL (HAS_RSYNC LIBBATCH_SSH_COMMAND AND LIBBATCH_RSYNC_COMMAND)
   
   # Mark shell commands as advanced options
   # and assign the names without the LIBBATCH_ in front:
-  SET (_cmds "RM;SH;CP;MKDIR;RSH;RCP;SSH;SCP")
+  SET (_cmds "RM;SH;CP;MKDIR;RSH;RCP;SSH;SCP;RSYNC")
   FOREACH(_cmd ${_cmds})    
     MARK_AS_ADVANCED(LIBBATCH_${_cmd}_COMMAND)
     SET(${_cmd}_COMMAND ${LIBBATCH_${_cmd}_COMMAND})
@@ -278,7 +280,8 @@ MACRO(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS pkg referenceVariable upCount)
         MESSAGE(STATUS "${pkg} found directory matches what was specified in the ${pkg_UC}_ROOT_DIR variable, all good!")    
       ENDIF()
     ELSE()
-        MESSAGE(STATUS "Environment variable ${pkg_UC}_ROOT_DIR is not defined. The system installation was found.")
+        MESSAGE(STATUS "Variable ${pkg_UC}_ROOT_DIR was not explicitly defined: "
+          "an installation was found anyway: ${_tmp_ROOT_DIR}")
     ENDIF()
 
     # 5. Conflict detection