root / gr-howto-write-a-block-cmake / swig / CMakeLists.txt @ aaa98c09
History | View | Annotate | Download (2.2 kB)
| 1 | # Copyright 2011 Free Software Foundation, Inc. |
|---|---|
| 2 | # |
| 3 | # This file is part of GNU Radio |
| 4 | # |
| 5 | # GNU Radio is free software; you can redistribute it and/or modify |
| 6 | # it under the terms of the GNU General Public License as published by |
| 7 | # the Free Software Foundation; either version 3, or (at your option) |
| 8 | # any later version. |
| 9 | # |
| 10 | # GNU Radio is distributed in the hope that it will be useful, |
| 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | # GNU General Public License for more details. |
| 14 | # |
| 15 | # You should have received a copy of the GNU General Public License |
| 16 | # along with GNU Radio; see the file COPYING. If not, write to |
| 17 | # the Free Software Foundation, Inc., 51 Franklin Street, |
| 18 | # Boston, MA 02110-1301, USA. |
| 19 | |
| 20 | ######################################################################## |
| 21 | # Include swig generation macros |
| 22 | ######################################################################## |
| 23 | find_package(SWIG) |
| 24 | find_package(PythonLibs) |
| 25 | if(NOT SWIG_FOUND OR NOT PYTHONLIBS_FOUND) |
| 26 | return() |
| 27 | endif() |
| 28 | include(GrSwig) |
| 29 | include(GrPython) |
| 30 | |
| 31 | ######################################################################## |
| 32 | # Setup swig generation |
| 33 | ######################################################################## |
| 34 | foreach(incdir ${GNURADIO_CORE_INCLUDE_DIRS})
|
| 35 | list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/swig)
|
| 36 | endforeach(incdir) |
| 37 | |
| 38 | foreach(incdir ${GRUEL_INCLUDE_DIRS})
|
| 39 | list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/gruel/swig)
|
| 40 | endforeach(incdir) |
| 41 | |
| 42 | set(GR_SWIG_LIBRARIES gnuradio-howto) |
| 43 | set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/howto_swig_doc.i)
|
| 44 | set(GR_SWIG_DOC_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../include)
|
| 45 | |
| 46 | GR_SWIG_MAKE(howto_swig howto_swig.i) |
| 47 | |
| 48 | ######################################################################## |
| 49 | # Install the build swig module |
| 50 | ######################################################################## |
| 51 | GR_SWIG_INSTALL(TARGETS howto_swig DESTINATION ${GR_PYTHON_DIR}/howto)
|
| 52 | |
| 53 | ######################################################################## |
| 54 | # Install swig .i files for development |
| 55 | ######################################################################## |
| 56 | install( |
| 57 | FILES |
| 58 | howto_swig.i |
| 59 | ${CMAKE_CURRENT_BINARY_DIR}/howto_swig_doc.i
|
| 60 | DESTINATION ${GR_INCLUDE_DIR}/howto/swig
|
| 61 | ) |