]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
*** empty log message ***
authoradam <adam>
Tue, 1 Feb 2011 13:40:19 +0000 (13:40 +0000)
committeradam <adam>
Tue, 1 Feb 2011 13:40:19 +0000 (13:40 +0000)
salome_adm/cmake_files/FindLIBBATCH.cmake [new file with mode: 0644]
salome_adm/cmake_files/Makefile.am
salome_adm/cmake_files/am2cmake.py

diff --git a/salome_adm/cmake_files/FindLIBBATCH.cmake b/salome_adm/cmake_files/FindLIBBATCH.cmake
new file mode 100644 (file)
index 0000000..28589bb
--- /dev/null
@@ -0,0 +1,137 @@
+#  Copyright (C) 2007-2010  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
+#
+#  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 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
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+# ------
+
+MESSAGE(STATUS "Check for libbatch ...")
+
+# ------
+
+IF(LIBBATCH_IS_MANDATORY STREQUAL 0)
+  SET(LIBBATCH_IS_MANDATORY 0)
+  SET(LIBBATCH_IS_OPTIONAL 1)
+ENDIF(LIBBATCH_IS_MANDATORY STREQUAL 0)
+IF(LIBBATCH_IS_OPTIONAL STREQUAL 0)
+  SET(LIBBATCH_IS_MANDATORY 1)
+  SET(LIBBATCH_IS_OPTIONAL 0)
+ENDIF(LIBBATCH_IS_OPTIONAL STREQUAL 0)
+IF(NOT LIBBATCH_IS_MANDATORY AND NOT LIBBATCH_IS_OPTIONAL)
+  SET(LIBBATCH_IS_MANDATORY 0)
+  SET(LIBBATCH_IS_OPTIONAL 1)
+ENDIF(NOT LIBBATCH_IS_MANDATORY AND NOT LIBBATCH_IS_OPTIONAL)
+
+# ------
+
+SET(LIBBATCH_STATUS 1)
+IF(WITHOUT_LIBBATCH OR WITH_LIBBATCH STREQUAL 0)
+  SET(LIBBATCH_STATUS 0)
+  MESSAGE(STATUS "libbatch disabled from command line.")
+ENDIF(WITHOUT_LIBBATCH OR WITH_LIBBATCH STREQUAL 0)
+
+# ------
+
+IF(LIBBATCH_STATUS)
+  IF(WITH_LIBBATCH)
+    SET(LIBBATCH_ROOT_USER ${WITH_LIBBATCH})
+  ELSE(WITH_LIBBATCH)
+    SET(LIBBATCH_ROOT_USER $ENV{LIBBATCH_ROOT_DIR})
+  ENDIF(WITH_LIBBATCH)
+ENDIF(LIBBATCH_STATUS)
+
+# -----
+
+IF(LIBBATCH_STATUS)
+  IF(LIBBATCH_ROOT_USER)
+    SET(LIBBATCH_FIND_PATHS_OPTION NO_DEFAULT_PATH)
+  ELSE(LIBBATCH_ROOT_USER)
+    SET(LIBBATCH_FIND_PATHS_OPTION)
+  ENDIF(LIBBATCH_ROOT_USER)
+ENDIF(LIBBATCH_STATUS)
+
+# -----
+
+IF(LIBBATCH_STATUS)
+  IF(LIBBATCH_ROOT_USER)
+    SET(LIBBATCH_INCLUDE_PATHS ${LIBBATCH_ROOT_USER} ${LIBBATCH_ROOT_USER}/include)
+  ELSE(LIBBATCH_ROOT_USER)
+    SET(LIBBATCH_INCLUDE_PATHS)
+  ENDIF(LIBBATCH_ROOT_USER)
+  SET(LIBBATCH_INCLUDE_TO_FIND Batch/Batch_BatchManager.hxx)
+  FIND_PATH(LIBBATCH_INCLUDE_DIR ${LIBBATCH_INCLUDE_TO_FIND} PATHS ${LIBBATCH_INCLUDE_PATHS} ${LIBBATCH_FIND_PATHS_OPTION})
+  IF(LIBBATCH_INCLUDE_DIR)
+    IF(LIBBATCH_ROOT_USER)
+      SET(LIBBATCH_INCLUDES -I${LIBBATCH_INCLUDE_DIR})
+    ENDIF(LIBBATCH_ROOT_USER)
+    MESSAGE(STATUS "${LIBBATCH_INCLUDE_TO_FIND} found in ${LIBBATCH_INCLUDE_DIR}")
+  ELSE(LIBBATCH_INCLUDE_DIR)
+    SET(LIBBATCH_STATUS 0)
+    IF(LIBBATCH_ROOT_USER)
+      MESSAGE(STATUS "${LIBBATCH_INCLUDE_TO_FIND} not found in ${LIBBATCH_INCLUDE_PATHS}, check your LIBBATCH installation.")
+    ELSE(LIBBATCH_ROOT_USER)
+      MESSAGE(STATUS "${LIBBATCH_INCLUDE_TO_FIND} not found on system, try to use WITH_LIBBATCH option or LIBBATCH_ROOT environment variable.")
+    ENDIF(LIBBATCH_ROOT_USER)
+  ENDIF(LIBBATCH_INCLUDE_DIR)
+ENDIF(LIBBATCH_STATUS)
+
+# ----
+
+IF(LIBBATCH_STATUS)
+  IF(LIBBATCH_ROOT_USER)
+    SET(LIBBATCH_LIB_PATHS ${LIBBATCH_ROOT_USER}/lib)
+  ELSE(LIBBATCH_ROOT_USER)
+    SET(LIBBATCH_LIB_PATHS)
+  ENDIF(LIBBATCH_ROOT_USER)
+ENDIF(LIBBATCH_STATUS)
+
+IF(LIBBATCH_STATUS)
+  IF(WINDOWS)
+    FIND_LIBRARY(LIBBATCH_LIB Batch PATHS ${LIBBATCH_LIB_PATHS} ${LIBBATCH_FIND_PATHS_OPTION})
+  ELSE(WINDOWS)
+    FIND_LIBRARY(LIBBATCH_LIB Batch PATHS ${LIBBATCH_LIB_PATHS} ${LIBBATCH_FIND_PATHS_OPTION})
+  ENDIF(WINDOWS)
+  SET(LIBBATCH_LIBS)
+  IF(LIBBATCH_LIB)
+    SET(LIBBATCH_LIBS ${LIBBATCH_LIBS} ${LIBBATCH_LIB})
+    MESSAGE(STATUS "libbatch lib found: ${LIBBATCH_LIB}")
+  ELSE(LIBBATCH_LIB)
+    SET(LIBBATCH_STATUS 0)
+    IF(LIBBATCH_ROOT_USER)
+      MESSAGE(STATUS "libbatch lib not found in ${LIBBATCH_LIB_PATHS}, check your LIBBATCH installation.")
+    ELSE(LIBBATCH_ROOT_USER)
+      MESSAGE(STATUS "libbatch lib not found on system, try to use WITH_LIBBATCH option or LIBBATCH_ROOT environment variable.")
+    ENDIF(LIBBATCH_ROOT_USER)
+  ENDIF(LIBBATCH_LIB)
+ENDIF(LIBBATCH_STATUS)
+
+# ----
+
+IF(LIBBATCH_STATUS)
+  SET(WITH_LIBBATCH 1)
+ELSE(LIBBATCH_STATUS)
+  IF(LIBBATCH_IS_MANDATORY)
+    MESSAGE(FATAL_ERROR "libbatch not found ... mandatory ... abort")
+  ELSE(LIBBATCH_IS_MANDATORY)
+    MESSAGE(STATUS "libbatch not found ... optional ... disabled")
+  ENDIF(LIBBATCH_IS_MANDATORY)
+ENDIF(LIBBATCH_STATUS)
+
+# ------
index b08680ccb171f0373b30008b7429e952ea856e33..9d01c594bd5631a1230dd76ee185063ff84912a0 100644 (file)
@@ -30,6 +30,7 @@ FindCPPUNIT.cmake \
 FindDOXYGEN.cmake \
 FindHDF5.cmake \
 FindKERNEL.cmake \
+FindLIBBATCH.cmake \
 FindLIBXML2.cmake \
 FindMPI.cmake \
 FindOMNIORB.cmake \
index 9fb8632dce4f7ee7e0734eedec71ecfd0864de44..9d991e3ee296b6788d4725fa9e1f1786114a4692 100644 (file)
@@ -479,6 +479,7 @@ class CMakeFile(object):
                 INCLUDE(${CMAKE_SOURCE_DIR}/salome_adm/cmake_files/FindCPPUNIT.cmake)
                 INCLUDE(${CMAKE_SOURCE_DIR}/salome_adm/cmake_files/FindDOXYGEN.cmake)
                 INCLUDE(${CMAKE_SOURCE_DIR}/salome_adm/cmake_files/FindMPI.cmake)
+                INCLUDE(${CMAKE_SOURCE_DIR}/salome_adm/cmake_files/FindLIBBATCH.cmake)
                 """)
                 pass
             else:
@@ -497,6 +498,7 @@ class CMakeFile(object):
                     INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindCPPUNIT.cmake)
                     INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindDOXYGEN.cmake)
                     INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindMPI.cmake)
+                    INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindLIBBATCH.cmake)
                     INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindKERNEL.cmake)
                     ELSE(KERNEL_ROOT_DIR)
                     INCLUDE(${CMAKE_SOURCE_DIR}/adm_local_without_kernel/cmake_files/FindPLATFORM.cmake)
@@ -517,6 +519,7 @@ class CMakeFile(object):
                     INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindCPPUNIT.cmake)
                     INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindDOXYGEN.cmake)
                     INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindMPI.cmake)
+                    INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindLIBBATCH.cmake)
                     INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindKERNEL.cmake)
                     """)
                     pass
@@ -656,6 +659,13 @@ class CMakeFile(object):
                 SET(ENABLE_QXGRAPHVIEWER ON)
                 """)
                 pass
+            elif self.module == "jobmanager":
+                newlines.append("""
+                IF(GUI_ROOT_DIR)
+                SET(HAS_GUI ON)
+                ENDIF(GUI_ROOT_DIR)
+                """)
+                pass
             elif self.module == "geom":
                 newlines.append("""
                 IF(GUI_ROOT_DIR)
@@ -1356,7 +1366,7 @@ class CMakeFile(object):
             newlines.append('''
             FOREACH(output ${MOC_FILES})
             ''')
-            if self.module == "yacs":
+            if self.module in ["jobmanager", "yacs"]:
                 newlines.append('''
                 STRING(REGEX REPLACE _moc.cxx .hxx input ${output})
                 ''')
@@ -1505,6 +1515,9 @@ class CMakeFile(object):
             "salomepypkg_PYTHON"               :  "${salomepypkgdir}",
             "mypkgpython_PYTHON"               :  "${mypkgpythondir}",
             }
+        if self.module == "jobmanager":
+            d["bin_SCRIPTS"] = "bin"
+            pass
         if self.module == "medfile":
             d = {
                 "include_HEADERS"        :  "include",
@@ -2008,7 +2021,7 @@ class CMakeFile(object):
         # --
         self.setLibAdd(key, newlines)
         # --
-        if self.module in ["medfile", "netgen"]:
+        if self.module in ["jobmanager", "medfile", "netgen"]:
             newlines.append(r'''
             SET(DEST bin)
             ''')