--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -177,6 +177,7 @@
 check_include_files(sys/uio.h HAVE_SYS_UIO_H)
 check_include_files(eXosip2/eXosip.h HAVE_EXOSIP2)
 check_include_files(srtp/srtp.h HAVE_SRTP)
+check_include_files(ortp/ortp.h HAVE_ORTP)
 #check_include_files(vpbapi.h HAVE_VPBAPI)
 #check_include_files(capi20.h HAVE_CAPI20)
 #check_include_files(sys/telephony.h HAVE_SYS_TELEPHONY_H)
@@ -230,6 +231,10 @@
     set(EXOSIP2_LIBS eXosip2 osip2 osipparser2)
 endif()
 
+if(HAVE_ORTP)
+    set(ORTP_LIBS ortp)
+endif()
+
 check_include_files(resolv.h HAVE_RESOLV)
 if(HAVE_RESOLV)
     set(EXOSIP2_LIBS ${EXOSIP2_LIBS} resolv)
@@ -258,7 +263,7 @@
     add_subdirectory(test)
 endif()
 
-if(HAVE_EXOSIP2)
+if(HAVE_EXOSIP2 AND HAVE_ORTP)
     add_subdirectory(sipwitch)
 endif()