Salome HOME
EDF request: supress a modification of the LD_LIBRARY_PATH in ZCracksPlug.
[modules/smesh.git] / src / SMESH_SWIG_WITHIHM / CMakeLists.txt
1 # Copyright (C) 2012-2016  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_SOURCE_DIR}/src/OBJECT
39   ${PROJECT_SOURCE_DIR}/src/SMESHDS
40   ${PROJECT_SOURCE_DIR}/src/SMDS
41   ${PROJECT_BINARY_DIR}/idl
42 )
43
44 # additional preprocessor / compiler flags
45 ADD_DEFINITIONS(
46   ${CAS_DEFINITIONS}
47   ${OMNIORB_DEFINITIONS}
48   ${PYTHON_DEFINITIONS}
49 )
50
51 # libraries to link to
52 SET(_link_LIBRARIES
53   ${KERNEL_SalomeGenericObj}
54   ${KERNEL_SALOMELocalTrace}
55   ${GUI_CAM}
56   ${GUI_suit}
57   ${GUI_qtx}
58   ${GUI_SalomeApp}
59   ${GUI_std}
60   ${GUI_Event}
61   SMESH
62 )
63
64 # --- headers ---
65
66 # header files / to be processed by moc
67 SET(SMESH_Swig_HEADERS
68   libSMESH_Swig.h
69   libSMESH_Swig.i
70 )
71
72 # --- sources ---
73
74 # sources / static
75 SET(SMESH_Swig_SOURCES
76   libSMESH_Swig.cxx
77   ${SMESH_Swig_HEADERS}
78 )
79
80 # workaround about SWIG_ADD_MODULE bug: remove duplicates in include directories
81 GET_DIRECTORY_PROPERTY(_cmake_include_directories INCLUDE_DIRECTORIES)
82 LIST(REMOVE_DUPLICATES _cmake_include_directories)
83 SET_DIRECTORY_PROPERTIES(PROPERTIES INCLUDE_DIRECTORIES "${_cmake_include_directories}")
84
85 # swig flags
86 SET_SOURCE_FILES_PROPERTIES(libSMESH_Swig.i PROPERTIES CPLUSPLUS ON)
87 SET_SOURCE_FILES_PROPERTIES(libSMESH_Swig.i PROPERTIES SWIG_DEFINITIONS "-shadow")
88 SET_SOURCE_FILES_PROPERTIES(libSMESH_swig_wrap.cpp PROPERTIES COMPILE_FLAGS "-DHAVE_CONFIG_H")
89
90 # --- scripts ---
91
92 # scripts / swig wrappings
93 SET(_swig_SCRIPTS
94   ${CMAKE_CURRENT_BINARY_DIR}/libSMESH_Swig.py 
95 )
96
97 # --- rules ---
98
99 SWIG_ADD_MODULE(libSMESH_Swig python ${SMESH_Swig_SOURCES})
100 SWIG_LINK_LIBRARIES(libSMESH_Swig ${_link_LIBRARIES})
101 IF(WIN32)
102   SET_TARGET_PROPERTIES(_libSMESH_Swig PROPERTIES DEBUG_OUTPUT_NAME _libSMESH_Swig_d)
103 ENDIF(WIN32)
104
105 INSTALL(TARGETS _libSMESH_Swig DESTINATION ${SALOME_INSTALL_LIBS})
106
107 INSTALL(FILES ${SMESH_Swig_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
108
109 SALOME_INSTALL_SCRIPTS("${_swig_SCRIPTS}"  ${SALOME_INSTALL_BINS})