Salome HOME
23080: [CEA 1497] Do not merge a middle node in quadratic with the extreme nodes...
[modules/smesh.git] / src / SMESH_SWIG_WITHIHM / CMakeLists.txt
1 # Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
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   ${QT_INCLUDES}
26   ${PYTHON_INCLUDE_DIRS}
27   ${CAS_INCLUDE_DIRS}
28   ${VTK_INCLUDE_DIRS}
29   ${OGL_INCLUDE_DIRS}
30   ${KERNEL_INCLUDE_DIRS}
31   ${GUI_INCLUDE_DIRS}
32   ${MEDFILE_INCLUDE_DIRS}
33   ${GEOM_INCLUDE_DIRS}
34   ${OMNIORB_INCLUDE_DIR}
35   ${Boost_INCLUDE_DIRS}
36   ${CMAKE_CURRENT_SOURCE_DIR}
37   ${PROJECT_SOURCE_DIR}/src/SMESHGUI
38   ${PROJECT_BINARY_DIR}/idl
39 )
40
41 # additional preprocessor / compiler flags
42 ADD_DEFINITIONS(
43   ${CAS_DEFINITIONS}
44   ${OMNIORB_DEFINITIONS}
45   ${PYTHON_DEFINITIONS}
46 )
47
48 # libraries to link to
49 SET(_link_LIBRARIES
50   ${KERNEL_SalomeGenericObj}
51   ${KERNEL_SALOMELocalTrace}
52   ${GUI_CAM}
53   ${GUI_suit}
54   ${GUI_qtx}
55   ${GUI_SalomeApp}
56   ${GUI_std}
57   ${GUI_Event}
58   SMESH
59 )
60
61 # --- headers ---
62
63 # header files / to be processed by moc
64 SET(SMESH_Swig_HEADERS
65   libSMESH_Swig.h
66   libSMESH_Swig.i
67 )
68
69 # --- sources ---
70
71 # sources / static
72 SET(SMESH_Swig_SOURCES
73   libSMESH_Swig.cxx
74   ${SMESH_Swig_HEADERS}
75 )
76
77 # workaround about SWIG_ADD_MODULE bug: remove duplicates in include directories
78 GET_DIRECTORY_PROPERTY(_cmake_include_directories INCLUDE_DIRECTORIES)
79 LIST(REMOVE_DUPLICATES _cmake_include_directories)
80 SET_DIRECTORY_PROPERTIES(PROPERTIES INCLUDE_DIRECTORIES "${_cmake_include_directories}")
81
82 # swig flags
83 SET_SOURCE_FILES_PROPERTIES(libSMESH_Swig.i PROPERTIES CPLUSPLUS ON)
84 SET_SOURCE_FILES_PROPERTIES(libSMESH_Swig.i PROPERTIES SWIG_DEFINITIONS "-shadow")
85 SET_SOURCE_FILES_PROPERTIES(libSMESH_swig_wrap.cpp PROPERTIES COMPILE_FLAGS "-DHAVE_CONFIG_H")
86
87 # --- scripts ---
88
89 # scripts / swig wrappings
90 SET(_swig_SCRIPTS
91   ${CMAKE_CURRENT_BINARY_DIR}/libSMESH_Swig.py 
92 )
93
94 # --- rules ---
95
96 SWIG_ADD_MODULE(libSMESH_Swig python ${SMESH_Swig_SOURCES})
97 SWIG_LINK_LIBRARIES(libSMESH_Swig ${_link_LIBRARIES})
98 IF(WIN32)
99   SET_TARGET_PROPERTIES(_libSMESH_Swig PROPERTIES DEBUG_OUTPUT_NAME _libSMESH_Swig_d)
100 ENDIF(WIN32)
101
102 INSTALL(TARGETS _libSMESH_Swig DESTINATION ${SALOME_INSTALL_LIBS})
103
104 INSTALL(FILES ${SMESH_Swig_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
105
106 SALOME_INSTALL_SCRIPTS("${_swig_SCRIPTS}"  ${SALOME_INSTALL_BINS})