aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoman Khassraf <roman@khassraf.at>2015-07-17 13:57:24 +0200
committerRoman Khassraf <roman@khassraf.at>2015-07-17 13:57:24 +0200
commit9c58846b0462958068adb3ec5dc04cc18874dffb (patch)
tree2d1e404bdcc1002509f8b9f6738a0bcfd7779986
parentf329ae5633b98bec3365c6337099b25fca469188 (diff)
Added libosmocore to build. Preparation for issue #85
-rw-r--r--CMakeLists.txt5
-rw-r--r--cmake/Modules/FindLibosmocore.cmake42
-rw-r--r--lib/CMakeLists.txt2
3 files changed, 48 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7a88ba6..c8fac31 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -93,6 +93,7 @@ find_package(Gnuradio)
find_package(Volk)
find_package(CppUnit)
find_package(Doxygen)
+find_package(Libosmocore)
if(NOT GNURADIO_RUNTIME_FOUND)
message(FATAL_ERROR "GnuRadio Runtime required to compile gr-gsm")
@@ -103,6 +104,9 @@ endif()
if(NOT CPPUNIT_FOUND)
message(FATAL_ERROR "CppUnit required to compile gr-gsm")
endif()
+if(NOT LIBOSMOCORE_FOUND)
+ message(FATAL_ERROR "Libosmocore required to compile gr-gsm")
+endif()
########################################################################
# Setup doxygen option
@@ -124,6 +128,7 @@ include_directories(
${Boost_INCLUDE_DIRS}
${CPPUNIT_INCLUDE_DIRS}
${GNURADIO_RUNTIME_INCLUDE_DIRS}
+ ${LIBOSMOCORE_INCLUDE_DIR}
)
link_directories(
diff --git a/cmake/Modules/FindLibosmocore.cmake b/cmake/Modules/FindLibosmocore.cmake
new file mode 100644
index 0000000..9eff233
--- /dev/null
+++ b/cmake/Modules/FindLibosmocore.cmake
@@ -0,0 +1,42 @@
+find_package(PkgConfig)
+pkg_check_modules(PC_libosmocore libosmocore)
+set(LIBOSMOCORE_DEFINITIONS ${PC_LIBOSMOCORE_CFLAGS_OTHER})
+
+find_path(
+ LIBOSMOCORE_INCLUDE_DIR
+ NAMES osmocom/core/application.h
+ HINTS ${PC_libosmocore_INCLUDEDIR}
+ ${PC_libosmocore_INCLUDE_DIRS}
+ ${CMAKE_INSTALL_PREFIX}/include
+ PATHS /usr/local/include
+ /usr/include
+)
+
+find_library(
+ LIBOSMOCORE_LIBRARY
+ NAMES libosmocore osmocore
+ HINTS ${PC_libosmocore_LIBDIR}
+ ${PC_libosmocore_LIBRARY_DIRS}
+ ${CMAKE_INSTALL_PREFIX}/lib/
+ ${CMAKE_INSTALL_PREFIX}/lib64/
+ PATHS /usr/local/lib
+ /usr/lib
+)
+
+find_library(
+ LIBOSMOCORE_GSM_LIBRARY
+ NAMES libosmogsm osmogsm
+ HINTS ${PC_libosmocore_LIBDIR}
+ ${PC_libosmocore_LIBRARY_DIRS}
+ ${CMAKE_INSTALL_PREFIX}/lib/
+ ${CMAKE_INSTALL_PREFIX}/lib64/
+ PATHS /usr/local/lib
+ /usr/lib
+)
+
+set(LIBOSMOCORE_LIBRARIES ${LIBOSMOCORE_LIBRARY} ${LIBOSMOCORE_GSM_LIBRARY})
+set(LIBOSMOCORE_INCLUDE_DIRS ${LIBOSMOCORE_INCLUDE_DIR})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(libosmocore DEFAULT_MSG LIBOSMOCORE_LIBRARY LIBOSMOCORE_INCLUDE_DIR)
+mark_as_advanced(LIBOSMOCORE_INCLUDE_DIR LIBOSMOCORE_LIBRARY )
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index f2d70e3..d906396 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -55,7 +55,7 @@ list(APPEND grgsm_sources
decryption/decryption_impl.cc )
add_library(gnuradio-grgsm SHARED ${grgsm_sources})
-target_link_libraries(gnuradio-grgsm ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${VOLK_LIBRARIES}
+target_link_libraries(gnuradio-grgsm ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${VOLK_LIBRARIES} ${LIBOSMOCORE_LIBRARIES}
# libraries required by plotting.h - have troubles to be installed by pybombs
# boost_iostreams
# boost_system