#
# Copyright (C) 2022-2023 David Hampton
#
# See the file LICENSE_FSF for licensing information.
#

#
# The cmake documentation strongly recommands against globbing source file
# names, thus this explicit list of filenames.
#
set(PYFILES
    bbciplayer.py
    bliptv.py
    comedycentral.py
    dailymotion.py
    hulu.py
    mnvsearch.py
    mtv.py
    nature.py
    pbs.py
    rev3.py
    space.py
    technology.py
    tedtalks.py
    thewb.py
    trailers.py
    vimeo.py
    youtube.py)

#
# This directory is processed regardless of USING_BINDINGS_PYTHON.
#
unset(PROCESSED_FILES)
fix_shebang_install_python("internetcontent" PYFILES)
install(DIRECTORY nv_python_libs
        DESTINATION ${CMAKE_INSTALL_DATADIR}/mythtv/internetcontent)

# This custom target dependes on all of the files generated by the
# fix_shebang_install_python macro, which is what causes those commands to
# actually be executed.
add_custom_target(internetcontent ALL DEPENDS ${PROCESSED_FILES})

#
# The perl files can be easily installed without any processing
#
if(USING_BINDINGS_PERL)
  install(FILES topdocumentaryfilm.pl twit.tv.pl
          DESTINATION ${CMAKE_INSTALL_DATADIR}/mythtv/internetcontent)
  install(
    FILES nv_perl_libs/mnvcommonsubs.pm
    DESTINATION ${CMAKE_INSTALL_DATADIR}/mythtv/internetcontent/nv_perl_libs)
endif()
