Salome HOME
6889d06dd4c30399789aa1689613ce76914b091a
[tools/py2cpp.git] / src / CMakeLists.txt
1 # Copyright (C) 2019  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   TypeConversions.hxx
40   PyFunction.hxx
41   Errors.hxx
42   PyPtr.hxx
43   Result.hxx
44 )
45
46 ADD_LIBRARY(py2cpp ${_py2cpp_sources})
47 TARGET_LINK_LIBRARIES(py2cpp ${_link_LIBRARIES})
48 TARGET_INCLUDE_DIRECTORIES(py2cpp PUBLIC
49                           $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
50                           $<INSTALL_INTERFACE:${INSTALL_CMAKE_DIR}/include>)
51
52 INSTALL(TARGETS py2cpp EXPORT FindPy2cpp LIBRARY DESTINATION lib)
53 INSTALL(FILES ${_py2cpp_headers} DESTINATION include/py2cpp)
54 INSTALL(EXPORT FindPy2cpp DESTINATION cmake)
55
56 ADD_SUBDIRECTORY(Test)