piotr | 437f546 | 2014-02-04 17:57:25 +0100 | [diff] [blame] | 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 | ######################################################################## |
ptrkrysik | 6ecbfca | 2014-08-14 14:57:10 +0200 | [diff] [blame] | 21 | # Check if there is C++ code at all |
| 22 | ######################################################################## |
| 23 | if(NOT lol_sources) |
| 24 | MESSAGE(STATUS "No C++ sources... skipping swig/") |
| 25 | return() |
| 26 | endif(NOT lol_sources) |
| 27 | |
| 28 | ######################################################################## |
piotr | 437f546 | 2014-02-04 17:57:25 +0100 | [diff] [blame] | 29 | # Include swig generation macros |
| 30 | ######################################################################## |
| 31 | find_package(SWIG) |
| 32 | find_package(PythonLibs 2) |
| 33 | if(NOT SWIG_FOUND OR NOT PYTHONLIBS_FOUND) |
| 34 | return() |
| 35 | endif() |
| 36 | include(GrSwig) |
| 37 | include(GrPython) |
| 38 | |
| 39 | ######################################################################## |
| 40 | # Setup swig generation |
| 41 | ######################################################################## |
| 42 | foreach(incdir ${GNURADIO_RUNTIME_INCLUDE_DIRS}) |
| 43 | list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/gnuradio/swig) |
| 44 | endforeach(incdir) |
| 45 | |
| 46 | set(GR_SWIG_LIBRARIES gnuradio-gsm) |
| 47 | set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/gsm_swig_doc.i) |
| 48 | set(GR_SWIG_DOC_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../include) |
| 49 | |
| 50 | GR_SWIG_MAKE(gsm_swig gsm_swig.i) |
| 51 | |
| 52 | ######################################################################## |
| 53 | # Install the build swig module |
| 54 | ######################################################################## |
| 55 | GR_SWIG_INSTALL(TARGETS gsm_swig DESTINATION ${GR_PYTHON_DIR}/gsm) |
| 56 | |
| 57 | ######################################################################## |
| 58 | # Install swig .i files for development |
| 59 | ######################################################################## |
| 60 | install( |
| 61 | FILES |
| 62 | gsm_swig.i |
| 63 | ${CMAKE_CURRENT_BINARY_DIR}/gsm_swig_doc.i |
| 64 | DESTINATION ${GR_INCLUDE_DIR}/gsm/swig |
| 65 | ) |