Conditional compilation of local libosmocore depending if there is or is not libosmocore installation present on the system
diff --git a/lib/decoding/CMakeLists.txt b/lib/decoding/CMakeLists.txt
index cbf2a8e..bb5ddde 100644
--- a/lib/decoding/CMakeLists.txt
+++ b/lib/decoding/CMakeLists.txt
@@ -17,11 +17,16 @@
 # the Free Software Foundation, Inc., 51 Franklin Street,
 # Boston, MA 02110-1301, USA.
 
-add_subdirectory(osmocom/coding)
-add_subdirectory(osmocom/core)
-add_subdirectory(osmocom/codec)
-add_subdirectory(osmocom/gsm)
-add_subdirectory(osmocom/crypt)
+if(NOT LIBOSMOCORE_FOUND OR NOT LIBOSMOCODEC_FOUND)
+    message(STATUS "Libosmocore installation not found - compiling local version")
+    add_subdirectory(osmocom/core)
+    add_subdirectory(osmocom/codec)
+    add_subdirectory(osmocom/gsm)
+elseif(NOT LIBOSMOCODING_FOUND)
+    message(STATUS "Libosmocore found but libosmocoding is missing - compiling local version")
+    add_subdirectory(osmocom/coding)
+endif()
+
 add_subdirectory(openbts)
 
 add_sources(