xref: /libbtbb/python/pcaptools/CMakeLists.txt (revision 48fe012ac445727d6a0bf0074d6f218d5616862f)
1e25b118aSDominic Spill# Copyright 2013 Dominic Spill
2e25b118aSDominic Spill#
3e25b118aSDominic Spill# This file is part of Libbtbb (pcapdump)
4e25b118aSDominic Spill#
5e25b118aSDominic Spill# GNU Radio is free software; you can redistribute it and/or modify
6e25b118aSDominic Spill# it under the terms of the GNU General Public License as published by
7e25b118aSDominic Spill# the Free Software Foundation; either version 2, or (at your option)
8e25b118aSDominic Spill# any later version.
9e25b118aSDominic Spill#
10e25b118aSDominic Spill# GNU Radio is distributed in the hope that it will be useful,
11e25b118aSDominic Spill# but WITHOUT ANY WARRANTY; without even the implied warranty of
12e25b118aSDominic Spill# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13e25b118aSDominic Spill# GNU General Public License for more details.
14e25b118aSDominic Spill#
15e25b118aSDominic Spill# You should have received a copy of the GNU General Public License
16e25b118aSDominic Spill# along with GNU Radio; see the file COPYING.  If not, write to
17e25b118aSDominic Spill# the Free Software Foundation, Inc., 51 Franklin Street,
18e25b118aSDominic Spill# Boston, MA 02110-1301, USA.
19e25b118aSDominic Spill
20e25b118aSDominic Spillset(SETUP_PY_IN ${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in)
21e25b118aSDominic Spillset(SETUP_PY    ${CMAKE_CURRENT_BINARY_DIR}/setup.py)
22e25b118aSDominic Spillset(DEPS        ${CMAKE_CURRENT_SOURCE_DIR}/pcapdump/__init__.py
23e25b118aSDominic Spill                ${CMAKE_CURRENT_SOURCE_DIR}/pcapdump/pcapdump.py)
24e25b118aSDominic Spillset(OUTPUT      ${CMAKE_CURRENT_BINARY_DIR}/build)
25e25b118aSDominic Spill
26e25b118aSDominic Spillconfigure_file(${SETUP_PY_IN} ${SETUP_PY})
27e25b118aSDominic Spill
28e25b118aSDominic Spilladd_custom_command(OUTPUT ${OUTPUT}/timestamp
29*48fe012aSMike Ryan                   COMMAND ${Python3_EXECUTABLE} setup.py build
30e25b118aSDominic Spill                   COMMAND ${CMAKE_COMMAND} -E touch ${OUTPUT}/timestamp
31e25b118aSDominic Spill                   DEPENDS ${DEPS})
32e25b118aSDominic Spill
33e25b118aSDominic Spilladd_custom_target(pcapdump ALL DEPENDS ${OUTPUT}/timestamp)
34b0a38200SDominic Spillinstall(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} ${SETUP_PY} build -b ${OUTPUT} install --prefix=${BUILD_ROOT}/${CMAKE_INSTALL_PREFIX})")
35e25b118aSDominic Spill
36e25b118aSDominic Spilladd_custom_target(btaptap ALL DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/btaptap)
37e25b118aSDominic Spillinstall(PROGRAMS btaptap DESTINATION ${INSTALL_DEFAULT_BINDIR})
38e25b118aSDominic Spill
39