diff --git a/CMakeLists.txt b/CMakeLists.txt index a7b309337..04b20247b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -203,6 +203,8 @@ set(ZM_NO_X10 "OFF" CACHE BOOL set(ZM_ONVIF "ON" CACHE BOOL "Set to ON to enable basic ONVIF support. This is EXPERIMENTAL and may not work with all cameras claiming to be ONVIF compliant. default: ON") +set(ZM_NO_RTSPSERVER "OFF" CACHE BOOL + "Set to ON to skip live555 checks and force building ZM without rtsp server support. default: OFF") set(ZM_PERL_MM_PARMS INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 CACHE STRING "By default, ZoneMinder's Perl modules are installed into the Vendor folders, as defined by your installation of Perl. You can change that here. Consult Perl's @@ -710,6 +712,21 @@ endif(NOT ZM_NO_LIBVNC) ##set(CMAKE_REQUIRED_INCLUDES "${Boost_INCLUDE_DIRS}") #list(APPEND ZM_BIN_LIBS "${Boost_LIBRARIES}") #endif() + +if(NOT ZM_NO_RTSPSERVER) + find_package(Live555) + if(Live555_FOUND) + include_directories(${Live555_INCLUDE_DIRS}) + set(CMAKE_REQUIRED_INCLUDES "${Live555_INCLUDE_DIRS}") + list(APPEND ZM_BIN_LIBS "${Live555_LIBRARIES}") + set(HAVE_RTSP_SERVER 1) + else(Live555_FOUND) + set(HAVE_RTSP_SERVER 0) + endif(Live555_FOUND) +else(NOT ZM_NO_RTSPSERVER) + set(HAVE_RTSP_SERVER 0) +endif(NOT ZM_NO_RTSPSERVER) + # # *** END OF LIBRARY CHECKS *** diff --git a/cmake/Modules/FindLive555.cmake b/cmake/Modules/FindLive555.cmake new file mode 100644 index 000000000..c0f8550d1 --- /dev/null +++ b/cmake/Modules/FindLive555.cmake @@ -0,0 +1,75 @@ +# Try to find Live555 libraries +# Once done this will define +# Live555_FOUND +# Live555_INCLUDE_DIRS +# Live555_LIBRARIES + +if (NOT Live555_FOUND) + set(_Live555_FOUND ON) + + foreach (library liveMedia BasicUsageEnvironment Groupsock UsageEnvironment) + + string(TOLOWER ${library} lowercase_library) + + find_path(Live555_${library}_INCLUDE_DIR + NAMES + ${library}.hh + ${lowercase_library}.hh + PATHS + ${Live555_ROOT}/${library}/include + ${Live555_ROOT}/live/${library}/include + /usr/include/${library} + /usr/local/include/${library} + /usr/include/${lowercase_library} + /usr/local/include/${lowercase_library} + ) + + if (Live555_${library}_INCLUDE_DIR) + list(APPEND _Live555_INCLUDE_DIRS ${Live555_${library}_INCLUDE_DIR}) + else() + set(_Live555_FOUND OFF) + endif () + + foreach (mode DEBUG RELEASE) + find_library(Live555_${library}_LIBRARY_${mode} + NAMES + ${library} + ${lowercase_library} + PATHS + ${Live555_ROOT}/lib/${mode} + ${Live555_ROOT}/${library} + ) + if (Live555_${library}_LIBRARY_${mode}) + if (${mode} STREQUAL RELEASE) + list(APPEND _Live555_LIBRARIES optimized ${Live555_${library}_LIBRARY_${mode}}) + elseif (${mode} STREQUAL DEBUG) + list(APPEND _Live555_LIBRARIES debug ${Live555_${library}_LIBRARY_${mode}}) + else () + MESSAGE(STATUS no) + list(APPEND _Live555_LIBRARIES ${Live555_${library}_LIBRARY_${mode}}) + endif() + else() + set(_Live555_FOUND OFF) + endif () + endforeach () + + endforeach () + + if (_Live555_FOUND) + set(Live555_INCLUDE_DIRS ${_Live555_INCLUDE_DIRS} CACHE INTERNAL "") + set(Live555_LIBRARIES ${_Live555_LIBRARIES} CACHE INTERNAL "") + set(Live555_FOUND ${_Live555_FOUND} CACHE BOOL "" FORCE) + endif() + + include(FindPackageHandleStandardArgs) + # handle the QUIETLY and REQUIRED arguments and set LOGGING_FOUND to TRUE + # if all listed variables are TRUE + find_package_handle_standard_args(Live555 DEFAULT_MSG Live555_INCLUDE_DIRS Live555_LIBRARIES Live555_FOUND) + + # Tell cmake GUIs to ignore the "local" variables. + mark_as_advanced(Live555_INCLUDE_DIRS Live555_LIBRARIES Live555_FOUND) +endif (NOT Live555_FOUND) + +if (Live555_FOUND) + message(STATUS "Found live555") +endif()