]> SALOME platform Git repositories - modules/yacs.git/blob - src/yacsloader_swig/CMakeLists.txt
Salome HOME
Python 3: porting tests
[modules/yacs.git] / src / yacsloader_swig / CMakeLists.txt
1 # Copyright (C) 2012-2016  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 IF(SALOME_BUILD_TESTS)
23   ADD_SUBDIRECTORY(Test)
24 ENDIF(SALOME_BUILD_TESTS)
25
26 # --- options ---
27
28 # additional include directories
29 INCLUDE_DIRECTORIES(
30   ${PROJECT_SOURCE_DIR}/src/bases
31   ${PROJECT_SOURCE_DIR}/src/engine
32   ${PROJECT_SOURCE_DIR}/src/engine_swig
33   ${PROJECT_SOURCE_DIR}/src/yacsloader
34   ${PROJECT_BINARY_DIR}/src/engine_swig
35   ${OMNIORB_INCLUDE_DIR}
36   ${OMNIORBPY_INCLUDE_DIR}
37   ${PYTHON_INCLUDE_DIRS}
38 )
39
40 # swig flags
41 SET_SOURCE_FILES_PROPERTIES(loader.i PROPERTIES 
42                                     CPLUSPLUS ON 
43                                     SWIG_DEFINITIONS "-shadow")
44 SET_PROPERTY(SOURCE loader.i PROPERTY 
45                     SWIG_FLAGS "-noexcept" "-DYACS_PTHREAD")
46
47 # additional preprocessor / compiler flags
48 ADD_DEFINITIONS(
49   ${PYTHON_DEFINITIONS}
50   ${OMNIORB_DEFINITIONS}
51   )
52
53 # libraries to link to
54 SET(_link_LIBRARIES
55   YACSloader
56   ${PYTHON_LIBRARIES}
57   ${OMNIORB_LIBRARIES}
58   )
59
60 # --- scripts ---
61 # scripts / swig wrappings
62 SET(_swig_SCRIPTS
63   ${CMAKE_CURRENT_BINARY_DIR}/loader.py
64 )
65
66 IF(WIN32)
67   SET(SET_CMD set)
68   SET(SEP_CMD &&)
69 ENDIF(WIN32)
70
71 IF(SALOME_BUILD_DOC)
72   ADD_CUSTOM_TARGET(docyacsloader.i
73     ${SET_CMD} DOXSRCDIR=${PROJECT_SOURCE_DIR}/src/yacsloader ${SEP_CMD} ${DOXYGEN_EXECUTABLE} ${PROJECT_SOURCE_DIR}/Misc/Doxyfile
74     COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/Misc/doxy2swig.py -n xml/index.xml docyacsloader.i
75     VERBATIM
76     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
77     )
78 ENDIF(SALOME_BUILD_DOC)
79
80 # --- rules ---
81 SET(SWIGINCLUDES 
82   ${PROJECT_SOURCE_DIR}/src/yacsloader/parsers.hxx
83   ${PROJECT_SOURCE_DIR}/src/yacsloader/LoadState.hxx
84   ${PROJECT_SOURCE_DIR}/src/yacsloader/xmlParserBase.hxx
85   ${PROJECT_SOURCE_DIR}/src/yacsloader/ProcCataLoader.hxx
86   )
87
88 SET(SWIG_MODULE_loader_EXTRA_DEPS 
89     ${PROJECT_SOURCE_DIR}/src/engine_swig/pilot.i 
90     ${PROJECT_SOURCE_DIR}/src/engine_swig/engtypemaps.i  
91     ${SWIGINCLUDES})
92 SWIG_ADD_MODULE(loader python loader.i)
93
94 SWIG_LINK_LIBRARIES(loader ${_link_LIBRARIES})
95 IF(WIN32)
96   SET_TARGET_PROPERTIES(_loader PROPERTIES DEBUG_OUTPUT_NAME _loader_d)
97 ENDIF(WIN32)
98
99 INSTALL(TARGETS ${SWIG_MODULE_loader_REAL_NAME} DESTINATION ${SALOME_INSTALL_PYTHON})
100
101 SALOME_INSTALL_SCRIPTS("${_swig_SCRIPTS}"  ${SALOME_INSTALL_PYTHON})