Salome HOME
e101c1f6e11e09f4d84c5dca8bf13dda286c08fe
[tools/libbatch.git] / CMakeLists.txt
1 #  Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
3 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 #
6 #  This library is free software; you can redistribute it and/or
7 #  modify it under the terms of the GNU Lesser General Public
8 #  License as published by the Free Software Foundation; either
9 #  version 2.1 of the License.
10 #
11 #  This library is distributed in the hope that it will be useful,
12 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 #  Lesser General Public License for more details.
15 #
16 #  You should have received a copy of the GNU Lesser General Public
17 #  License along with this library; if not, write to the Free Software
18 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 #
20 #  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #
22
23 project (libbatch)
24
25 cmake_minimum_required (VERSION 2.8)
26 set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules/)
27
28 find_package (PThread REQUIRED)
29
30 SET (BUILD_LOCAL_SUBMISSION TRUE CACHE BOOL "Build classes for local submission")
31 SET (BUILD_PYTHON_WRAPPING TRUE CACHE BOOL "Generate Python wrapping")
32 SET (TEST_ENABLED FALSE CACHE BOOL "Enable testing")
33
34 IF (TEST_ENABLED)
35     ENABLE_TESTING()
36 ENDIF (TEST_ENABLED)
37
38 IF (BUILD_LOCAL_SUBMISSION)
39     find_package (Local)
40 ENDIF (BUILD_LOCAL_SUBMISSION)
41 IF (BUILD_PYTHON_WRAPPING)
42     FIND_PACKAGE(PythonInterp)
43     IF (PYTHONINTERP_FOUND)
44         get_filename_component(PYTHON_BIN_DIR "${PYTHON_EXECUTABLE}" PATH)
45         get_filename_component(CMAKE_INCLUDE_PATH "${PYTHON_BIN_DIR}/../include/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}" ABSOLUTE)
46         get_filename_component(CMAKE_LIBRARY_PATH "${PYTHON_BIN_DIR}/../lib" ABSOLUTE)
47     ENDIF (PYTHONINTERP_FOUND)
48     FIND_PACKAGE(PythonLibs ${PYTHON_VERSION_STRING} EXACT)
49     FIND_PACKAGE(SWIG)
50 ENDIF (BUILD_PYTHON_WRAPPING)
51
52 SET(CPACK_GENERATOR TGZ)
53 SET(CPACK_SOURCE_GENERATOR TGZ ZIP)
54 SET(CPACK_PACKAGE_VERSION_MAJOR 2)
55 SET(CPACK_PACKAGE_VERSION_MINOR 0)
56 SET(CPACK_PACKAGE_VERSION_PATCH 0)
57 SET(CPACK_SOURCE_IGNORE_FILES /\\\\.;/CVS/;~)
58 SET(CPACK_SOURCE_PACKAGE_FILE_NAME
59     ${PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
60
61 configure_file (${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
62
63 INCLUDE(Summary)
64
65 add_subdirectory (src)
66 add_subdirectory (misc)
67
68 INCLUDE(CPack)
69
70 MARK_AS_ADVANCED(CMAKE_BACKWARDS_COMPATIBILITY EXECUTABLE_OUTPUT_PATH)