Salome HOME
38854a1fcd5cb3444bf72ae61b2a6e37bcef4d47
[tools/py2cpp.git] / src / CMakeLists.txt
1 # Copyright (C) 2019-2021 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 INCLUDE_DIRECTORIES(
20   ${PYTHON_INCLUDE_DIR}
21 )
22
23 ADD_DEFINITIONS(
24   ${PYTHON_DEFINITIONS}
25 )
26
27 SET(_link_LIBRARIES
28   ${PYTHON_LIBRARIES}
29 )
30
31 SET(_py2cpp_sources
32   TypeConversions.cxx
33   PyFunction.cxx
34   Errors.cxx
35   PyPtr.cxx
36 )
37
38 SET(_py2cpp_headers
39   py2cppExports.hxx
40   TypeConversions.hxx
41   PyFunction.hxx
42   Errors.hxx
43   PyPtr.hxx
44   Result.hxx
45   py2cpp.hxx
46 )
47
48 ADD_LIBRARY(py2cpp ${_py2cpp_sources})
49 TARGET_LINK_LIBRARIES(py2cpp ${_link_LIBRARIES})
50 TARGET_INCLUDE_DIRECTORIES(py2cpp PUBLIC
51                           $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
52                           $<INSTALL_INTERFACE:include>)
53
54 INSTALL(TARGETS py2cpp EXPORT Py2cppCfg LIBRARY DESTINATION lib)
55 INSTALL(FILES ${_py2cpp_headers} DESTINATION include/py2cpp)
56 INSTALL(EXPORT Py2cppCfg DESTINATION lib/cmake/py2cpp FILE Py2cppConfig.cmake)
57
58 ADD_SUBDIRECTORY(Test)