diff --git a/CMakeLists.txt b/CMakeLists.txt index e45b0b4ec..82b8648eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -246,13 +246,32 @@ find_library(MP4V2_LIBRARIES mp4v2) if(MP4V2_LIBRARIES) set(HAVE_LIBMP4V2 1) list(APPEND ZM_BIN_LIBS "${MP4V2_LIBRARIES}") + + # mp4v2/mp4v2.h + find_path(MP4V2_INCLUDE_DIR mp4v2/mp4v2.h) + if(MP4V2_INCLUDE_DIR) + include_directories("${MP4V2_INCLUDE_DIR}") + set(CMAKE_REQUIRED_INCLUDES "${MP4V2_INCLUDE_DIR}") + endif(MP4V2_INCLUDE_DIR) + check_include_file("mp4v2/mp4v2.h" HAVE_MP4V2_MP4V2_H) + + # mp4v2.h + find_path(MP4V2_INCLUDE_DIR mp4v2.h) + if(MP4V2_INCLUDE_DIR) + include_directories("${MP4V2_INCLUDE_DIR}") + set(CMAKE_REQUIRED_INCLUDES "${MP4V2_INCLUDE_DIR}") + endif(MP4V2_INCLUDE_DIR) + check_include_file("mp4v2.h" HAVE_MP4V2_H) + + # mp4.h find_path(MP4V2_INCLUDE_DIR mp4.h) if(MP4V2_INCLUDE_DIR) include_directories("${MP4V2_INCLUDE_DIR}") set(CMAKE_REQUIRED_INCLUDES "${MP4V2_INCLUDE_DIR}") endif(MP4V2_INCLUDE_DIR) - mark_as_advanced(FORCE MP4V2_LIBRARIES MP4V2_INCLUDE_DIR) check_include_file("mp4.h" HAVE_MP4_H) + + mark_as_advanced(FORCE MP4V2_LIBRARIES MP4V2_INCLUDE_DIR) set(optlibsfound "${optlibsfound} mp4v2") else(MP4V2_LIBRARIES) set(optlibsnotfound "${optlibsnotfound} mp4v2") diff --git a/configure.ac b/configure.ac index dfd204bf4..7b6a1a44e 100644 --- a/configure.ac +++ b/configure.ac @@ -315,7 +315,7 @@ AC_CHECK_HEADERS(sys/shm.h,,,) fi AC_CHECK_HEADERS(zlib.h,,,) AC_CHECK_HEADERS(x264.h,,,) -AC_CHECK_HEADERS(mp4.h,,,) +AC_CHECK_HEADERS([mp4v2/mp4v2.h mp4v2.h mp4.h],,,) if test "$ZM_SSL_LIB" == "openssl"; then AC_CHECK_DECLS(MD5,,AC_MSG_ERROR([zm requires openssl/md5.h - use ZM_SSL_LIB option to select gnutls instead]),[#include diff --git a/src/zm_video.h b/src/zm_video.h index 622cc81bd..0bae5fb3d 100644 --- a/src/zm_video.h +++ b/src/zm_video.h @@ -29,6 +29,12 @@ #define HAVE_MP4_H 1 */ +#if HAVE_MP4V2_MP4V2_H +#include +#endif +#if HAVE_MP4V2_H +#include +#endif #if HAVE_MP4_H #include #endif diff --git a/zoneminder-config.cmake b/zoneminder-config.cmake index e86512fa9..ff2007f59 100644 --- a/zoneminder-config.cmake +++ b/zoneminder-config.cmake @@ -40,6 +40,8 @@ #cmakedefine HAVE_LIBX264 1 #cmakedefine HAVE_X264_H 1 #cmakedefine HAVE_LIBMP4V2 1 +#cmakedefine HAVE_MP4V2_MP4V2_H 1 +#cmakedefine HAVE_MP4V2_H 1 #cmakedefine HAVE_MP4_H 1 #cmakedefine HAVE_LIBAVFORMAT 1 #cmakedefine HAVE_LIBAVFORMAT_AVFORMAT_H 1