Skip to content

Commit

Permalink
Separating libosmogsm from the rest
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrkrysik authored and Piotr Krysik committed Jun 18, 2018
1 parent 9b5519d commit c711e97
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 17 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ find_package(CppUnit)
find_package(Libosmocore)
find_package(Libosmocodec)
find_package(Libosmocoding)
find_package(Libosmogsm)

if(NOT PKG_CONFIG_FOUND)
message(FATAL_ERROR "pkg-config is required to compile gr-gsm")
Expand Down
13 changes: 1 addition & 12 deletions cmake/Modules/FindLibosmocore.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#find_package(PkgConfig)
INCLUDE(FindPkgConfig)
pkg_check_modules(PC_libosmocore libosmocore)
pkg_check_modules(PC_libosmogsm libosmogsm)
set(LIBOSMOCORE_DEFINITIONS ${PC_LIBOSMOCORE_CFLAGS_OTHER})

find_path(
Expand All @@ -25,18 +24,8 @@ find_library(
/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_LIBRARIES ${LIBOSMOCORE_LIBRARY})
set(LIBOSMOCORE_INCLUDE_DIRS ${LIBOSMOCORE_INCLUDE_DIR})

include(FindPackageHandleStandardArgs)
Expand Down
32 changes: 32 additions & 0 deletions cmake/Modules/FindLibosmogsm.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
INCLUDE(FindPkgConfig)
pkg_check_modules(PC_libosmogsm libosmogsm)
set(LIBOSMOGSM_DEFINITIONS ${PC_LIBOSMOGSM_CFLAGS_OTHER})

find_path(
LIBOSMOGSM_INCLUDE_DIR
NAMES osmocom/gsm/gsm_utils.h
HINTS ${PC_libosmogsm_INCLUDEDIR}
${PC_libosmogsm_INCLUDE_DIRS}
${CMAKE_INSTALL_PREFIX}/include
PATHS /usr/local/include
/usr/include
)

find_library(
LIBOSMOGSM_LIBRARY
NAMES libosmogsm osmogsm
HINTS ${PC_libosmogsm_LIBDIR}
${PC_libosmogsm_LIBRARY_DIRS}
${CMAKE_INSTALL_PREFIX}/lib/
${CMAKE_INSTALL_PREFIX}/lib64/
PATHS /usr/local/lib
/usr/lib
)


set(LIBOSMOGSM_LIBRARIES ${LIBOSMOGSM_LIBRARY})
set(LIBOSMOGSM_INCLUDE_DIRS ${LIBOSMOGSM_INCLUDE_DIR})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(libosmogsm DEFAULT_MSG LIBOSMOGSM_LIBRARY LIBOSMOGSM_INCLUDE_DIR)
mark_as_advanced(LIBOSMOGSM_INCLUDE_DIR LIBOSMOGSM_LIBRARY )
6 changes: 2 additions & 4 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,13 @@ if(WIN32)
list (APPEND grgsm_link_libraries ws2_32)
endif()

if(LIBOSMOCORE_FOUND AND LIBOSMOCODEC_FOUND)
list (APPEND grgsm_link_libraries ${LIBOSMOCORE_LIBRARIES} ${LIBOSMOCODEC_LIBRARIES})
if(LIBOSMOCORE_FOUND AND LIBOSMOCODEC_FOUND AND LIBOSMOGSM_FOUND)
list (APPEND grgsm_link_libraries ${LIBOSMOCORE_LIBRARIES} ${LIBOSMOCODEC_LIBRARIES} ${LIBOSMOGSM_LIBRARY})
if(LIBOSMOCODING_FOUND)
list (APPEND grgsm_link_libraries ${LIBOSMOCODING_LIBRARIES})
endif()
endif()



add_library(grgsm SHARED ${grgsm_sources})
target_link_libraries(grgsm ${grgsm_link_libraries}
# libraries required by plotting.h - have troubles to be installed by pybombs
Expand Down
2 changes: 1 addition & 1 deletion lib/decoding/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.

if(NOT LIBOSMOCORE_FOUND OR NOT LIBOSMOCODEC_FOUND)
if(NOT LIBOSMOCORE_FOUND OR NOT LIBOSMOCODEC_FOUND OR NOT LIBOSMOGSM_FOUND)
add_subdirectory(osmocom/core)
add_subdirectory(osmocom/codec)
add_subdirectory(osmocom/gsm)
Expand Down

0 comments on commit c711e97

Please sign in to comment.