Salome HOME
Copyright update 2020
[tools/libbatch.git] / src / CMakeLists.txt
index 69ccb0e44e504813e33e2c772e2c158f05024b68..aaf88ebf3c8774531550e816faa0beeff5575658 100644 (file)
@@ -1,23 +1,23 @@
-#  Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2020  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
 #
 
 MACRO(APPEND_CLASSES_TO_SRC_FILES)
@@ -34,46 +34,51 @@ MACRO(APPEND_CLASSES_TO_HDR_FILES)
     SET(HDR_FILES ${HDR_FILES} PARENT_SCOPE)
 ENDMACRO(APPEND_CLASSES_TO_HDR_FILES)
 
-IF (MSVC)
-  add_definitions(/wd4251 /wd4290)  # Disable annoying Visual C++ warnings
-ENDIF (MSVC)
+IF (WIN32)
+  ADD_DEFINITIONS(/wd4251 /wd4290)  # Disable annoying Visual C++ warnings
+ENDIF (WIN32)
 
-include_directories(${PTHREAD_INCLUDE_DIR})
+INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR} 
+     ${PTHREAD_INCLUDE_DIR})
 
-add_subdirectory (Core)
+ADD_SUBDIRECTORY (Core)
 
-IF (BUILD_LOCAL_SUBMISSION)
-    add_subdirectory (Local)
-ENDIF (BUILD_LOCAL_SUBMISSION)
+IF (LIBBATCH_LOCAL_SUBMISSION)
+    ADD_SUBDIRECTORY (Local)
+ENDIF ()
 
-add_subdirectory (CCC)
-add_subdirectory (LSF)
-add_subdirectory (PBS)
-add_subdirectory (SGE)
-add_subdirectory (LoadLeveler)
-add_subdirectory (Slurm)
+ADD_SUBDIRECTORY (CCC)
+ADD_SUBDIRECTORY (LSF)
+ADD_SUBDIRECTORY (PBS)
+ADD_SUBDIRECTORY (OAR)
+ADD_SUBDIRECTORY (COORM)
+ADD_SUBDIRECTORY (SGE)
+ADD_SUBDIRECTORY (LoadLeveler)
+ADD_SUBDIRECTORY (Slurm)
 
 # Vishnu is not available for Windows
 IF (NOT WIN32)
-    add_subdirectory (Vishnu)
+    ADD_SUBDIRECTORY (Vishnu)
 ENDIF (NOT WIN32)
 
-add_library(batch SHARED ${SRC_FILES})
+ADD_LIBRARY (batch SHARED ${SRC_FILES})
 
-include_directories(${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/Core)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Local)
-target_link_libraries(batch ${PTHREAD_LIBRARY})
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Core)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Local)
+TARGET_LINK_LIBRARIES(batch ${PTHREAD_LIBRARY})
 
 IF (WIN32)
-    target_link_libraries(batch ws2_32)
+    TARGET_LINK_LIBRARIES(batch ws2_32)
 ENDIF (WIN32)
 
 # If necessary, activate all warnings (useful for debugging and code cleaning)
 # add_definitions(-Wall -Werror -ansi -pedantic)
 
-INSTALL(TARGETS batch DESTINATION lib)
+INSTALL(TARGETS batch 
+        EXPORT LibBatchTargets 
+        DESTINATION lib)
 INSTALL(FILES ${HDR_FILES} DESTINATION include/libbatch)
 
-IF (BUILD_PYTHON_WRAPPING AND PYTHONINTERP_FOUND AND PYTHONLIBS_FOUND AND SWIG_FOUND)
-    add_subdirectory (Python)
-ENDIF (BUILD_PYTHON_WRAPPING AND PYTHONINTERP_FOUND AND PYTHONLIBS_FOUND AND SWIG_FOUND)
+IF (LIBBATCH_PYTHON_WRAPPING AND PYTHONINTERP_FOUND AND PYTHONLIBS_FOUND AND SWIG_FOUND)
+    ADD_SUBDIRECTORY(Python)
+ENDIF ()