Vasil Velichkov | 1789ae2 | 2019-08-13 20:32:05 +0000 | [diff] [blame] | 1 | # Copyright 2011,2012,2016,2018,2019 Free Software Foundation, Inc. |
piotr | 437f546 | 2014-02-04 17:57:25 +0100 | [diff] [blame] | 2 | # |
Vasil Velichkov | 1789ae2 | 2019-08-13 20:32:05 +0000 | [diff] [blame] | 3 | # This file was generated by gr_modtool, a tool from the GNU Radio framework |
| 4 | # This file is a part of gr-gsm |
piotr | 437f546 | 2014-02-04 17:57:25 +0100 | [diff] [blame] | 5 | # |
| 6 | # GNU Radio is free software; you can redistribute it and/or modify |
| 7 | # it under the terms of the GNU General Public License as published by |
| 8 | # the Free Software Foundation; either version 3, or (at your option) |
| 9 | # any later version. |
| 10 | # |
| 11 | # GNU Radio is distributed in the hope that it will be useful, |
| 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | # GNU General Public License for more details. |
| 15 | # |
| 16 | # You should have received a copy of the GNU General Public License |
| 17 | # along with GNU Radio; see the file COPYING. If not, write to |
| 18 | # the Free Software Foundation, Inc., 51 Franklin Street, |
| 19 | # Boston, MA 02110-1301, USA. |
| 20 | |
Vasil Velichkov | 1789ae2 | 2019-08-13 20:32:05 +0000 | [diff] [blame] | 21 | ######################################################################## |
| 22 | # Setup library |
| 23 | ######################################################################## |
piotr | 437f546 | 2014-02-04 17:57:25 +0100 | [diff] [blame] | 24 | include(GrPlatform) #define LIB_SUFFIX |
Piotr Krysik | bb961c1 | 2017-08-24 15:35:42 +0200 | [diff] [blame] | 25 | |
| 26 | ######################################################################## |
Piotr Krysik | 0945cc5 | 2017-09-13 09:17:50 +0200 | [diff] [blame] | 27 | # Add sources macro |
| 28 | ######################################################################## |
| 29 | set(grgsm_sources "") |
| 30 | |
| 31 | macro (add_sources) |
| 32 | file (RELATIVE_PATH _relPath "${PROJECT_SOURCE_DIR}/lib" "${CMAKE_CURRENT_SOURCE_DIR}") |
| 33 | foreach (_src ${ARGN}) |
| 34 | if (_relPath) |
| 35 | list (APPEND grgsm_sources "${_relPath}/${_src}") |
| 36 | else() |
| 37 | list (APPEND grgsm_sources "${_src}") |
| 38 | endif() |
| 39 | endforeach() |
| 40 | if (_relPath) |
| 41 | # propagate grgsm_sources to parent directory |
| 42 | set (grgsm_sources ${grgsm_sources} PARENT_SCOPE) |
| 43 | endif() |
| 44 | endmacro() |
| 45 | |
| 46 | ######################################################################## |
Piotr Krysik | bb961c1 | 2017-08-24 15:35:42 +0200 | [diff] [blame] | 47 | # Handle the generated constants |
| 48 | ######################################################################## |
| 49 | execute_process(COMMAND ${PYTHON_EXECUTABLE} -c |
Vasil Velichkov | 1789ae2 | 2019-08-13 20:32:05 +0000 | [diff] [blame] | 50 | "import time;print(time.strftime('%a, %d %b %Y %H:%M:%S', time.gmtime()))" |
Piotr Krysik | bb961c1 | 2017-08-24 15:35:42 +0200 | [diff] [blame] | 51 | OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE |
| 52 | ) |
| 53 | message(STATUS "Loading build date ${BUILD_DATE} into constants...") |
| 54 | message(STATUS "Loading version ${VERSION} into constants...") |
| 55 | |
| 56 | #double escape for windows backslash path separators |
| 57 | string(REPLACE "\\" "\\\\" prefix "${prefix}") |
| 58 | |
| 59 | configure_file( |
| 60 | ${CMAKE_CURRENT_SOURCE_DIR}/constants.cc.in |
| 61 | ${CMAKE_CURRENT_BINARY_DIR}/constants.cc |
| 62 | ESCAPE_QUOTES |
| 63 | @ONLY) |
| 64 | |
Piotr Krysik | 184d706 | 2017-09-13 12:46:38 +0200 | [diff] [blame] | 65 | list(APPEND grgsm_sources ${CMAKE_CURRENT_BINARY_DIR}/constants.cc) |
Piotr Krysik | bb961c1 | 2017-08-24 15:35:42 +0200 | [diff] [blame] | 66 | ######################################################################### |
Piotr Krysik | 0945cc5 | 2017-09-13 09:17:50 +0200 | [diff] [blame] | 67 | # Subdirecories |
| 68 | ######################################################################### |
| 69 | add_subdirectory(decoding) |
| 70 | add_subdirectory(decryption) |
| 71 | add_subdirectory(demapping) |
| 72 | add_subdirectory(flow_control) |
| 73 | add_subdirectory(misc_utils) |
| 74 | add_subdirectory(qa_utils) |
| 75 | add_subdirectory(receiver) |
Piotr Krysik | 517464c | 2017-11-05 12:23:15 +0100 | [diff] [blame] | 76 | add_subdirectory(transmitter) |
Piotr Krysik | 9930553 | 2018-05-05 12:38:11 +0200 | [diff] [blame] | 77 | add_subdirectory(trx) |
piotr | 437f546 | 2014-02-04 17:57:25 +0100 | [diff] [blame] | 78 | |
Piotr Krysik | e4da417 | 2021-05-02 23:20:47 +0200 | [diff] [blame] | 79 | list (APPEND grgsm_link_libraries ${LIBOSMOCORE_LIBRARY} ${LIBOSMOCODEC_LIBRARY} ${LIBOSMOGSM_LIBRARY} ${LIBOSMOCODING_LIBRARY}) |
Piotr Krysik | 8bed612 | 2018-02-27 07:46:04 +0100 | [diff] [blame] | 80 | |
Piotr Krysik | 8722be5 | 2016-02-19 15:22:51 +0100 | [diff] [blame] | 81 | add_library(grgsm SHARED ${grgsm_sources}) |
Vasil Velichkov | b82bbeb | 2019-11-16 02:12:16 +0200 | [diff] [blame] | 82 | target_link_libraries(grgsm gnuradio::gnuradio-runtime gnuradio::gnuradio-filter volk ${grgsm_link_libraries}) |
Vasil Velichkov | 1789ae2 | 2019-08-13 20:32:05 +0000 | [diff] [blame] | 83 | target_include_directories(grgsm |
| 84 | PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include> |
| 85 | PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/receiver> |
Piotr Krysik | e4da417 | 2021-05-02 23:20:47 +0200 | [diff] [blame] | 86 | PUBLIC $<BUILD_INTERFACE:${LIBOSMOCORE_INCLUDE_DIR}> |
Vasil Velichkov | 1789ae2 | 2019-08-13 20:32:05 +0000 | [diff] [blame] | 87 | PUBLIC $<BUILD_INTERFACE:${Boost_INCLUDE_DIR}> |
| 88 | PUBLIC $<INSTALL_INTERFACE:include> |
| 89 | ) |
Piotr Krysik | 0fdbfdd | 2016-02-19 19:33:17 +0100 | [diff] [blame] | 90 | set_target_properties(grgsm PROPERTIES DEFINE_SYMBOL "grgsm_EXPORTS") |
Vasil Velichkov | 1789ae2 | 2019-08-13 20:32:05 +0000 | [diff] [blame] | 91 | |
| 92 | if(APPLE) |
| 93 | set_target_properties(grgsm PROPERTIES |
| 94 | INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" |
| 95 | ) |
| 96 | endif(APPLE) |
piotr | 437f546 | 2014-02-04 17:57:25 +0100 | [diff] [blame] | 97 | |
| 98 | ######################################################################## |
| 99 | # Install built library files |
| 100 | ######################################################################## |
Vasil Velichkov | 1789ae2 | 2019-08-13 20:32:05 +0000 | [diff] [blame] | 101 | include(GrMiscUtils) |
| 102 | GR_LIBRARY_FOO(grgsm) |
| 103 | |
| 104 | ######################################################################## |
| 105 | # Print summary |
| 106 | ######################################################################## |
| 107 | message(STATUS "Using install prefix: ${CMAKE_INSTALL_PREFIX}") |
| 108 | message(STATUS "Building for version: ${VERSION} / ${LIBVER}") |
| 109 | |
| 110 | set (grgsm_sources ${grgsm_sources} PARENT_SCOPE) |
piotr | 437f546 | 2014-02-04 17:57:25 +0100 | [diff] [blame] | 111 | |
| 112 | ######################################################################## |
| 113 | # Build and register unit test |
| 114 | ######################################################################## |
Vasil Velichkov | 1789ae2 | 2019-08-13 20:32:05 +0000 | [diff] [blame] | 115 | include(GrTest) |
piotr | 437f546 | 2014-02-04 17:57:25 +0100 | [diff] [blame] | 116 | |
Vasil Velichkov | 1789ae2 | 2019-08-13 20:32:05 +0000 | [diff] [blame] | 117 | # If your unit tests require special include paths, add them here |
| 118 | #include_directories() |
| 119 | # List all files that contain Boost.UTF unit tests here |
Piotr Krysik | 21b0f7d | 2020-02-16 08:46:26 +0100 | [diff] [blame] | 120 | list(APPEND test_grgsm_sources |
Vasil Velichkov | 1789ae2 | 2019-08-13 20:32:05 +0000 | [diff] [blame] | 121 | ) |
| 122 | # Anything we need to link to for the unit tests go here |
| 123 | list(APPEND GR_TEST_TARGET_DEPS grgsm) |
piotr | 437f546 | 2014-02-04 17:57:25 +0100 | [diff] [blame] | 124 | |
Piotr Krysik | 21b0f7d | 2020-02-16 08:46:26 +0100 | [diff] [blame] | 125 | if(NOT test_grgsm_sources) |
Vasil Velichkov | 1789ae2 | 2019-08-13 20:32:05 +0000 | [diff] [blame] | 126 | MESSAGE(STATUS "No C++ unit tests... skipping") |
| 127 | return() |
Piotr Krysik | 21b0f7d | 2020-02-16 08:46:26 +0100 | [diff] [blame] | 128 | endif(NOT test_grgsm_sources) |
piotr | 437f546 | 2014-02-04 17:57:25 +0100 | [diff] [blame] | 129 | |
Piotr Krysik | 21b0f7d | 2020-02-16 08:46:26 +0100 | [diff] [blame] | 130 | foreach(qa_file ${test_grgsm_sources}) |
| 131 | GR_ADD_CPP_TEST("grgsm_${qa_file}" |
Vasil Velichkov | 1789ae2 | 2019-08-13 20:32:05 +0000 | [diff] [blame] | 132 | ${CMAKE_CURRENT_SOURCE_DIR}/${qa_file} |
| 133 | ) |
| 134 | endforeach(qa_file) |