Salome HOME
d2a2981dcdb6760768f5ead2a908a7ee5d958663
[modules/hexablock.git] / src / HEXABLOCK_SWIG / CMakeLists.txt
1 # Copyright (C) 2012-2023  CEA, EDF
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 INCLUDE(${SWIG_USE_FILE})
21
22 # --- options ---
23 # additional include directories
24 INCLUDE_DIRECTORIES(
25   ${KERNEL_INCLUDE_DIRS}
26   ${PYTHON_INCLUDE_DIRS}
27   ${OpenCASCADE_INCLUDE_DIR}
28   ${GEOM_INCLUDE_DIRS}
29   ${Boost_INCLUDE_DIRS}
30   ${OMNIORB_INCLUDE_DIR}
31   ${PROJECT_SOURCE_DIR}/src/HEXABLOCK
32 )
33
34 # additional preprocessor / compiler flags
35 ADD_DEFINITIONS(
36   ${KERNEL_DEFINITIONS}
37   ${OpenCASCADE_DEFINITIONS}
38   ${BOOST_DEFINITIONS}
39 )
40
41 # libraries to link to
42 SET(_link_LIBRARIES
43   ${PYTHON_LIBRARIES}
44   ${OpenCASCADE_ModelingData_LIBRARIES}
45   ${OpenCASCADE_ModelingAlgorithms_LIBRARIES}
46   ${KERNEL_SALOMELocalTrace}
47   ${KERNEL_SALOMEBasics}
48   HEXABLOCKEngine
49 )
50
51 # swig flags
52 SET_SOURCE_FILES_PROPERTIES(hexablock_swig.i PROPERTIES CPLUSPLUS ON)
53 SET_SOURCE_FILES_PROPERTIES(hexablock_swig.i PROPERTIES SWIG_FLAGS "-py3")
54
55 # --- sources ---
56
57 # sources / static
58 SET(_hexablock_swig_SOURCES
59   hexablock_swig_wrap.cc 
60 )
61
62 # --- scripts ---
63
64 # scripts / static
65 SET(_bin_SCRIPTS
66   hexablock_swig.py 
67   hexablock.py
68 )
69
70 # --- rules ---
71
72 ADD_LIBRARY(hexablock_swig_lib ${_hexablock_swig_SOURCES})
73 TARGET_LINK_LIBRARIES(hexablock_swig_lib ${_link_LIBRARIES} )
74
75 IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") 
76   SWIG_ADD_MODULE(hexablock_swig python hexablock_swig.i)
77 ELSE()
78   SWIG_ADD_LIBRARY(hexablock_swig LANGUAGE python SOURCES hexablock_swig.i)
79 ENDIF()
80
81
82 SWIG_LINK_LIBRARIES(hexablock_swig ${_link_LIBRARIES} ${hexablock_swig_lib})
83 INSTALL(TARGETS _hexablock_swig DESTINATION ${SALOME_INSTALL_LIBS})
84
85 SALOME_INSTALL_SCRIPTS("${_bin_SCRIPTS}" ${SALOME_INSTALL_SCRIPT_PYTHON})