aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
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 /cmake
parentf329ae5633b98bec3365c6337099b25fca469188 (diff)
Added libosmocore to build. Preparation for issue #85
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/FindLibosmocore.cmake42
1 files changed, 42 insertions, 0 deletions
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 )