]> SALOME platform Git repositories - modules/yacs.git/blob - src/salomegui_swig/CMakeLists.txt
Salome HOME
Correction of bug when load from a state without node in error.
[modules/yacs.git] / src / salomegui_swig / CMakeLists.txt
1 # Copyright (C) 2012-2015  CEA/DEN, EDF R&D
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 # swig flags
23 SET_SOURCE_FILES_PROPERTIES(libYACS_Swig.i PROPERTIES 
24                                     CPLUSPLUS ON 
25                                     SWIG_DEFINITIONS "-shadow")
26 SET_PROPERTY(SOURCE libYACS_Swig.i PROPERTY 
27                     SWIG_FLAGS "-noexcept" "-DYACS_PTHREAD")
28
29 # --- options ---
30
31 IF(SALOME_YACS_USE_KERNEL)
32   SET(SALOME_INCL_PATH ${KERNEL_INCLUDE_DIRS})
33 ENDIF(SALOME_YACS_USE_KERNEL)
34
35 # additional include directories
36 INCLUDE_DIRECTORIES(
37   ${SALOME_INCL_PATH}
38   ${GUI_INCLUDE_DIRS}
39   ${CMAKE_CURRENT_SOURCE_DIR}
40   ${PROJECT_SOURCE_DIR}/src/salomegui
41   ${PROJECT_SOURCE_DIR}/src/salomewrap
42   ${OMNIORB_INCLUDE_DIR}
43 )
44
45 # additional preprocessor / compiler flags
46 ADD_DEFINITIONS(
47   ${QT_DEFINITIONS}
48   ${PYTHON_DEFINITIONS}
49   ${OMNIORB_DEFINITIONS}
50   ${BOOST_DEFINITIONS}
51   )
52
53 # libraries to link to
54 SET(_link_LIBRARIES
55   YACS
56   ${PYTHON_LIBRARIES}
57   )
58
59 # --- sources ---
60 SET(YACS_Swig_SOURCES
61   YACSGUI_Swig.cxx
62   )
63
64 # --- scripts ---
65 # scripts / swig wrappings
66 SET(_swig_SCRIPTS
67   ${CMAKE_CURRENT_BINARY_DIR}/libYACS_Swig.py
68 )
69
70 IF(WIN32)
71   SET(SET_CMD set)
72   SET(SEP_CMD &&)
73 ENDIF(WIN32)
74
75 IF(SALOME_BUILD_DOC)
76   ADD_CUSTOM_TARGET(doc.i
77     ${SET_CMD} DOXSRCDIR=${CMAKE_CURRENT_SOURCE_DIR} ${SEP_CMD} ${DOXYGEN_EXECUTABLE} ${PROJECT_SOURCE_DIR}/Misc/Doxyfile
78     COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/Misc/doxy2swig.py -n xml/index.xml doc.i
79     DEPENDS YACSGUI_Swig.hxx YACSGUI_Swig.cxx
80     VERBATIM
81     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
82     )
83 ENDIF(SALOME_BUILD_DOC)
84
85 # --- rules ---
86 ADD_LIBRARY(YACS_Swig ${YACS_Swig_SOURCES})
87 TARGET_LINK_LIBRARIES(YACS_Swig ${_link_LIBRARIES})
88 INSTALL(TARGETS YACS_Swig EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
89
90 SWIG_ADD_MODULE(libYACS_Swig python libYACS_Swig.i YACSGUI_Swig.cxx)
91 ADD_DEPENDENCIES(_libYACS_Swig libYACS_Swig.i doc.i YACSGUI_Swig.hxx)
92
93 SWIG_LINK_LIBRARIES(libYACS_Swig "${_link_LIBRARIES}")
94 IF(WIN32)
95   SET_TARGET_PROPERTIES(_libYACS_Swig PROPERTIES DEBUG_OUTPUT_NAME _libYACS_Swig_d)
96 ENDIF(WIN32)
97
98 INSTALL(TARGETS ${SWIG_MODULE_libYACS_Swig_REAL_NAME} DESTINATION ${SALOME_INSTALL_PYTHON})
99
100 SALOME_INSTALL_SCRIPTS("${_swig_SCRIPTS}" ${SALOME_INSTALL_PYTHON})