Salome HOME
Porting SWIG to Python3.
[tools/libbatch.git] / CMakeLists.txt
index 3a0c7c6818d6a68352ce472ed5ef45d6576c803b..a98507525da5f17fcd77bc5a7b3e5f99d3890640 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
 #
 
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR)
@@ -29,8 +29,8 @@ PROJECT(LibBatch C CXX)
 STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
 
 SET(${PROJECT_NAME_UC}_MAJOR_VERSION 2)
-SET(${PROJECT_NAME_UC}_MINOR_VERSION 0)
-SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
+SET(${PROJECT_NAME_UC}_MINOR_VERSION 4)
+SET(${PROJECT_NAME_UC}_PATCH_VERSION 1)
 SET(${PROJECT_NAME_UC}_VERSION
   ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
 
@@ -40,14 +40,21 @@ INCLUDE(libbatchMacros)
 
 # User options
 # ============
-SET(INSTALL_CMAKE_CONFIG_DIR share/cmake)
+IF(WIN32 AND NOT CYGWIN)
+  # This is really stupid: in the FIND_PACKAGE() command, the default paths 
+  # are not the same under Win and Nix (see CMake doc). This means we have to specify 
+  # different installation directories for LibBatchConfig.cmake:
+  SET(INSTALL_CMAKE_CONFIG_DIR cmake)
+ELSE()
+  SET(INSTALL_CMAKE_CONFIG_DIR share/cmake/libbatch)
+ENDIF()
 SET(INSTALL_INCLUDE_DIR include)
 
 SET(LIBBATCH_LOCAL_SUBMISSION TRUE CACHE BOOL "Build classes for local submission")
 SET(LIBBATCH_PYTHON_WRAPPING TRUE CACHE BOOL "Generate Python wrapping")
-SET(LIBBATCH_TESTS FALSE CACHE BOOL "Enable testing")
+SET(LIBBATCH_BUILD_TESTS FALSE CACHE BOOL "Enable testing")
 
-IF(LIBBATCH_TESTS)
+IF(LIBBATCH_BUILD_TESTS)
   ENABLE_TESTING()
 ENDIF()
 IF(LIBBATCH_LOCAL_SUBMISSION)
@@ -62,7 +69,7 @@ IF (LIBBATCH_PYTHON_WRAPPING)
   FIND_PACKAGE(LibbatchPython REQUIRED)
   FIND_PACKAGE(LibbatchSWIG REQUIRED)
   
-  MESSAGE("TODO TODO check Python path win32")
+  SET(PYTHON_VERSION "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
   SET(LIBBATCH_PYTHONPATH lib/python${PYTHON_VERSION}/site-packages)
 ENDIF()