blob: 9880e587702ff3b5a2cf7bb5d27bab04e2a6dbe7 [file] [log] [blame]
piotr437f5462014-02-04 17:57:25 +01001# Copyright 2011,2012 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########################################################################
21# Setup library
22########################################################################
23include(GrPlatform) #define LIB_SUFFIX
Piotr Krysikbb961c12017-08-24 15:35:42 +020024include(GrMiscUtils)
25
26########################################################################
27# Handle the generated constants
28########################################################################
29execute_process(COMMAND ${PYTHON_EXECUTABLE} -c
30 "import time;print time.strftime('%a, %d %b %Y %H:%M:%S', time.gmtime())"
31 OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE
32)
33message(STATUS "Loading build date ${BUILD_DATE} into constants...")
34message(STATUS "Loading version ${VERSION} into constants...")
35
36#double escape for windows backslash path separators
37string(REPLACE "\\" "\\\\" prefix "${prefix}")
38
39configure_file(
40 ${CMAKE_CURRENT_SOURCE_DIR}/constants.cc.in
41 ${CMAKE_CURRENT_BINARY_DIR}/constants.cc
42 ESCAPE_QUOTES
43@ONLY)
44
45list(APPEND grgsm_sources ${CMAKE_CURRENT_BINARY_DIR}/constants.cc)
46#########################################################################
piotr437f5462014-02-04 17:57:25 +010047
ptrkrysik18b631e2014-12-15 09:09:18 +010048include_directories(${Boost_INCLUDE_DIR} receiver)
piotr437f5462014-02-04 17:57:25 +010049link_directories(${Boost_LIBRARY_DIRS})
ptrkrysika25b8302015-05-08 08:59:17 +020050list(APPEND grgsm_sources
piotr7f3f3662014-07-08 16:47:53 +020051 receiver/receiver_impl.cc
Roman Khassraf8851d662015-06-07 16:42:37 +020052 receiver/receiver_config.cc
53 receiver/viterbi_detector.cc
Piotr Krysik70c25a12017-01-03 08:01:23 +010054 decoding/sch.c
ptrkrysikf8c7e832015-04-04 12:28:20 +020055 receiver/clock_offset_control_impl.cc
rpp4f0f3b52015-06-10 10:23:30 +020056 receiver/cx_channel_hopper_impl.cc
ptrkrysik6dded652014-11-19 11:32:05 +010057 demapping/universal_ctrl_chans_demapper_impl.cc
Roman Khassraffb6bc502015-04-14 15:44:40 +020058 demapping/tch_f_chans_demapper_impl.cc
piotrfaacc722014-07-20 23:48:32 +020059 decoding/control_channels_decoder_impl.cc
Roman Khassraf059bab92015-05-20 12:49:46 +020060 decoding/tch_f_decoder_impl.cc
Piotr Krysikb9a87a12017-08-23 15:59:28 +020061 decoding/openbts/AmrCoder.cpp
62 decoding/openbts/BitVector.cpp
63 decoding/openbts/GSM610Tables.cpp
64 decoding/openbts/GSM660Tables.cpp
65 decoding/openbts/GSM503Tables.cpp
66 decoding/openbts/ViterbiR204.cpp
Piotr Krysik70c25a12017-01-03 08:01:23 +010067 decoding/osmocom/coding/gsm0503_conv.c
68 decoding/osmocom/coding/gsm0503_coding.c
69 decoding/osmocom/coding/gsm0503_interleaving.c
70 decoding/osmocom/coding/gsm0503_mapping.c
71 decoding/osmocom/coding/gsm0503_parity.c
72 decoding/osmocom/coding/gsm0503_tables.c
Roman Khassrafdbc3a502015-08-03 23:20:20 +020073 flow_control/burst_timeslot_splitter_impl.cc
Roman Khassrafa1eb1882015-08-05 12:30:29 +020074 flow_control/burst_sdcch_subslot_splitter_impl.cc
Roman Khassrafd7e3eec2015-08-06 11:54:22 +020075 flow_control/burst_timeslot_filter_impl.cc
Roman Khassraf8b64d872015-08-06 17:30:04 +020076 flow_control/burst_sdcch_subslot_filter_impl.cc
Roman Khassraf8e3b0ec2015-08-04 11:16:04 +020077 flow_control/burst_fnr_filter_impl.cc
Roman Khassraf7cccb522015-08-04 12:26:54 +020078 flow_control/dummy_burst_filter_impl.cc
Piotr Krysika3405b22016-08-30 21:31:24 +020079 flow_control/uplink_downlink_splitter_impl.cc
Roman Khassraf98581a82017-01-11 12:50:38 +010080 misc_utils/collect_system_info_impl.cc
piotr4089c1a2014-08-06 14:10:56 +020081 misc_utils/controlled_rotator_cc_impl.cc
Piotr Krysik74c4f2c2016-07-15 13:12:46 +020082 misc_utils/controlled_fractional_resampler_cc_impl.cc
83 misc_utils/msg_to_tag_impl.cc
piotr4089c1a2014-08-06 14:10:56 +020084 misc_utils/message_printer_impl.cc
ptrkrysikdd700c12015-01-15 11:47:38 +010085 misc_utils/tmsi_dumper_impl.cc
Roman Khassraf1c3419e2015-08-03 10:58:57 +020086 misc_utils/burst_file_sink_impl.cc
87 misc_utils/burst_file_source_impl.cc
Roman Khassrafc3234542015-08-03 16:17:46 +020088 misc_utils/message_file_sink_impl.cc
Piotr Krysik74c4f2c2016-07-15 13:12:46 +020089 misc_utils/message_file_source_impl.cc
90 misc_utils/bursts_printer_impl.cc
91 misc_utils/extract_system_info_impl.cc
92 misc_utils/extract_immediate_assignment_impl.cc
Roman Khassrafe5ddab32016-12-04 16:19:40 +010093 misc_utils/extract_cmc_impl.cc
Roman Khassraf1ce44692015-08-03 11:16:10 +020094 qa_utils/burst_sink_impl.cc
95 qa_utils/burst_source_impl.cc
Roman Khassrafb8f49092015-08-03 10:08:18 +020096 qa_utils/message_source_impl.cc
97 qa_utils/message_sink_impl.cc
98 decryption/decryption_impl.cc
99)
piotr437f5462014-02-04 17:57:25 +0100100
piotr437f5462014-02-04 17:57:25 +0100101
Piotr Krysik8722be52016-02-19 15:22:51 +0100102add_library(grgsm SHARED ${grgsm_sources})
Piotr Krysik70c25a12017-01-03 08:01:23 +0100103target_link_libraries(grgsm ${Boost_LIBRARIES} ${GNURADIO_ALL_LIBRARIES} ${VOLK_LIBRARIES} ${LIBOSMOCODEC_LIBRARIES} ${LIBOSMOCORE_LIBRARIES}
104# ${LIBOSMOCODING_LIBRARIES}
ptrkrysik30f39452014-12-05 18:25:58 +0100105# libraries required by plotting.h - have troubles to be installed by pybombs
106# boost_iostreams
107# boost_system
108# boost_filesystem
piotr3f1ea812014-04-17 10:56:08 +0200109)
Piotr Krysik0fdbfdd2016-02-19 19:33:17 +0100110set_target_properties(grgsm PROPERTIES DEFINE_SYMBOL "grgsm_EXPORTS")
Piotr Krysikbb961c12017-08-24 15:35:42 +0200111GR_LIBRARY_FOO(grgsm)
piotr437f5462014-02-04 17:57:25 +0100112
113########################################################################
114# Install built library files
115########################################################################
Piotr Krysik8722be52016-02-19 15:22:51 +0100116install(TARGETS grgsm
piotr437f5462014-02-04 17:57:25 +0100117 LIBRARY DESTINATION lib${LIB_SUFFIX} # .so/.dylib file
118 ARCHIVE DESTINATION lib${LIB_SUFFIX} # .lib file
119 RUNTIME DESTINATION bin # .dll file
120)
121
122########################################################################
123# Build and register unit test
124########################################################################
piotr7f3f3662014-07-08 16:47:53 +0200125#include(GrTest)
piotr437f5462014-02-04 17:57:25 +0100126
piotr7f3f3662014-07-08 16:47:53 +0200127#include_directories(${CPPUNIT_INCLUDE_DIRS})
piotr437f5462014-02-04 17:57:25 +0100128
ptrkrysika25b8302015-05-08 08:59:17 +0200129#list(APPEND test_grgsm_sources
piotr7f3f3662014-07-08 16:47:53 +0200130# ${CMAKE_CURRENT_SOURCE_DIR}/test_gsm.cc
131# ${CMAKE_CURRENT_SOURCE_DIR}/qa_gsm.cc
132# ${CMAKE_CURRENT_SOURCE_DIR}/qa_receiver.cc
133#)
piotr437f5462014-02-04 17:57:25 +0100134
ptrkrysika25b8302015-05-08 08:59:17 +0200135#add_executable(test-gsm ${test_grgsm_sources})
piotr437f5462014-02-04 17:57:25 +0100136
piotr7f3f3662014-07-08 16:47:53 +0200137#target_link_libraries(
138# test-gsm
139# ${GNURADIO_RUNTIME_LIBRARIES}
140# ${Boost_LIBRARIES}
141# ${CPPUNIT_LIBRARIES}
Piotr Krysik8722be52016-02-19 15:22:51 +0100142# grgsm
piotr7f3f3662014-07-08 16:47:53 +0200143#)
piotr437f5462014-02-04 17:57:25 +0100144
piotr7f3f3662014-07-08 16:47:53 +0200145#GR_ADD_TEST(test_gsm test-gsm)