# Copyright 2011,2012,2016,2018,2019 Free Software Foundation, Inc.
#
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-lora2
#
# GNU Radio 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, or (at your option)
# any later version.
#
# GNU Radio 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 GNU Radio; see the file COPYING.  If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.

########################################################################
# Setup library
########################################################################
include(GrPlatform) #define LIB_SUFFIX
list(APPEND lora2_sources
    css_llr_converter_impl.cc
    css_mod_impl.cc
    lora_add_preamble_impl.cc
    lora_depad_impl.cc
    lora_merge_rem_impl.cc
    lora_whiten_impl.cc
    lora_soft_depad_impl.cc
    lora_header_format.cc
    lora_pad_impl.cc
    lora_drop_rem_impl.cc
    gray_encode_impl.cc
    gray_decode_impl.cc
    soft_gray_encode_impl.cc
    lora_low_rate_opt_tx_impl.cc
    lora_low_rate_opt_rx_impl.cc
    flip_half_bytes_impl.cc
    lora_crc_impl.cc
    lora_soft_low_rate_opt_rx_impl.cc
    lora_interleaver_impl.cc
    lora_deinterleaver_impl.cc
    lora_soft_deinterleaver_impl.cc
    lora_hamming_encode_impl.cc
    lora_hamming_decode_impl.cc
    lora_soft_hamming_decode_impl.cc
    css_mod_algo.cc
    lora_add_reversed_chirps_impl.cc
    css_demod_algo.cc )

set(lora2_sources "${lora2_sources}" PARENT_SCOPE)
if(NOT lora2_sources)
    MESSAGE(STATUS "No C++ sources... skipping lib/")
    return()
endif(NOT lora2_sources)

add_library(gnuradio-lora2 SHARED ${lora2_sources})
target_link_libraries(gnuradio-lora2 gnuradio::gnuradio-runtime gnuradio::gnuradio-digital)
target_include_directories(gnuradio-lora2
    PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
    PUBLIC $<INSTALL_INTERFACE:include>
  )
set_target_properties(gnuradio-lora2 PROPERTIES DEFINE_SYMBOL "gnuradio_lora2_EXPORTS")

if(APPLE)
    set_target_properties(gnuradio-lora2 PROPERTIES
        INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib"
    )
endif(APPLE)

########################################################################
# Install built library files
########################################################################
include(GrMiscUtils)
GR_LIBRARY_FOO(gnuradio-lora2)

########################################################################
# Print summary
########################################################################
message(STATUS "Using install prefix: ${CMAKE_INSTALL_PREFIX}")
message(STATUS "Building for version: ${VERSION} / ${LIBVER}")
