#
# Copyright 2013 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

#####################################################################
# Setup python install
#####################################################################
include(GrPython)
if(NOT PYTHONINTERP_FOUND)
    return()
endif()

list(APPEND python_sources
    __init__.py
    css_constants.py
    css_phy.py
    css_mod.py
    css_demod.py
)
GR_PYTHON_INSTALL(
    FILES ${python_sources}
    DESTINATION ${GR_PYTHON_DIR}/ieee802_15_4
    COMPONENT "ieee802_15_4_python"
)

#####################################################################
# Handle the unit tests
#####################################################################
set(GR_TEST_LIBRARY_DIRS "")
set(GR_TEST_TARGET_DEPS gnuradio-ieee802_15_4)
set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/swig)

include(GrTest)
file(GLOB py_qa_test_files "qa_*.py")
foreach(py_qa_test_file ${py_qa_test_files})
  get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE)
  GR_ADD_TEST(${py_qa_test_name} ${QA_PYTHON_EXECUTABLE} ${PYTHON_DASH_B} ${py_qa_test_file})
endforeach(py_qa_test_file)
