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 | ######################################################################## |
piotr | 437f546 | 2014-02-04 17:57:25 +0100 | [diff] [blame] | 21 | # Include swig generation macros |
| 22 | ######################################################################## |
| 23 | find_package(SWIG) |
| 24 | find_package(PythonLibs 2) |
| 25 | if(NOT SWIG_FOUND OR NOT PYTHONLIBS_FOUND) |
| 26 | return() |
| 27 | endif() |
| 28 | include(GrSwig) |
| 29 | include(GrPython) |
| 30 | |
iZsh | 868abf7 | 2015-08-16 13:50:20 +0200 | [diff] [blame] | 31 | IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") |
| 32 | # Mac OS X specific code |
| 33 | # Without this flag it does not find some of the libraries |
| 34 | SET(CMAKE_MODULE_LINKER_FLAGS "-undefined dynamic_lookup") |
| 35 | ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") |
| 36 | |
piotr | 437f546 | 2014-02-04 17:57:25 +0100 | [diff] [blame] | 37 | ######################################################################## |
| 38 | # Setup swig generation |
| 39 | ######################################################################## |
| 40 | foreach(incdir ${GNURADIO_RUNTIME_INCLUDE_DIRS}) |
| 41 | list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/gnuradio/swig) |
| 42 | endforeach(incdir) |
Piotr Krysik | 89cac10 | 2016-02-17 12:11:02 +0100 | [diff] [blame] | 43 | list(APPEND GR_SWIG_INCLUDE_DIRS ${FFTW3F_INCLUDE_DIRS}) |
piotr | 437f546 | 2014-02-04 17:57:25 +0100 | [diff] [blame] | 44 | |
Piotr Krysik | 89cac10 | 2016-02-17 12:11:02 +0100 | [diff] [blame] | 45 | set(GR_SWIG_LIBRARIES grgsm) |
ptrkrysik | 3be74a7 | 2014-12-13 10:11:00 +0100 | [diff] [blame] | 46 | set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/grgsm_swig_doc.i) |
piotr | 437f546 | 2014-02-04 17:57:25 +0100 | [diff] [blame] | 47 | set(GR_SWIG_DOC_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../include) |
| 48 | |
ptrkrysik | 3be74a7 | 2014-12-13 10:11:00 +0100 | [diff] [blame] | 49 | GR_SWIG_MAKE(grgsm_swig grgsm_swig.i) |
piotr | 437f546 | 2014-02-04 17:57:25 +0100 | [diff] [blame] | 50 | |
| 51 | ######################################################################## |
| 52 | # Install the build swig module |
| 53 | ######################################################################## |
ptrkrysik | 3be74a7 | 2014-12-13 10:11:00 +0100 | [diff] [blame] | 54 | GR_SWIG_INSTALL(TARGETS grgsm_swig DESTINATION ${GR_PYTHON_DIR}/grgsm) |
piotr | 437f546 | 2014-02-04 17:57:25 +0100 | [diff] [blame] | 55 | |
| 56 | ######################################################################## |
| 57 | # Install swig .i files for development |
| 58 | ######################################################################## |
| 59 | install( |
| 60 | FILES |
ptrkrysik | 3be74a7 | 2014-12-13 10:11:00 +0100 | [diff] [blame] | 61 | grgsm_swig.i |
Piotr Krysik | bb961c1 | 2017-08-24 15:35:42 +0200 | [diff] [blame] | 62 | constants.i |
ptrkrysik | 3be74a7 | 2014-12-13 10:11:00 +0100 | [diff] [blame] | 63 | ${CMAKE_CURRENT_BINARY_DIR}/grgsm_swig_doc.i |
| 64 | DESTINATION ${GR_INCLUDE_DIR}/grgsm/swig |
piotr | 437f546 | 2014-02-04 17:57:25 +0100 | [diff] [blame] | 65 | ) |