remove option to build with no ffmpeg (#2365)

This commit is contained in:
Andrew Bauer 2018-12-28 09:46:27 -06:00 committed by Isaac Connor
parent a029909972
commit 893048c306
2 changed files with 123 additions and 130 deletions

View File

@ -186,8 +186,6 @@ set(ZM_MYSQL_ENGINE "InnoDB" CACHE STRING
set(ZM_NO_MMAP "OFF" CACHE BOOL set(ZM_NO_MMAP "OFF" CACHE BOOL
"Set to ON to not use mmap shared memory. Shouldn't be enabled unless you "Set to ON to not use mmap shared memory. Shouldn't be enabled unless you
experience problems with the shared memory. default: OFF") experience problems with the shared memory. default: OFF")
set(ZM_NO_FFMPEG "OFF" CACHE BOOL
"Set to ON to skip ffmpeg checks and force building ZM without ffmpeg. default: OFF")
set(ZM_NO_LIBVLC "OFF" CACHE BOOL set(ZM_NO_LIBVLC "OFF" CACHE BOOL
"Set to ON to skip libvlc checks and force building ZM without libvlc. default: OFF") "Set to ON to skip libvlc checks and force building ZM without libvlc. default: OFF")
set(ZM_NO_CURL "OFF" CACHE BOOL set(ZM_NO_CURL "OFF" CACHE BOOL
@ -518,141 +516,137 @@ endif(MP4V2_LIBRARIES)
set(PATH_FFMPEG "") set(PATH_FFMPEG "")
set(OPT_FFMPEG "no") set(OPT_FFMPEG "no")
# Do not check for ffmpeg if ZM_NO_FFMPEG is on # avformat (using find_library and find_path)
if(NOT ZM_NO_FFMPEG) find_library(AVFORMAT_LIBRARIES avformat)
# avformat (using find_library and find_path) if(AVFORMAT_LIBRARIES)
find_library(AVFORMAT_LIBRARIES avformat) set(HAVE_LIBAVFORMAT 1)
if(AVFORMAT_LIBRARIES) list(APPEND ZM_BIN_LIBS "${AVFORMAT_LIBRARIES}")
set(HAVE_LIBAVFORMAT 1) find_path(AVFORMAT_INCLUDE_DIR "libavformat/avformat.h" /usr/include/ffmpeg)
list(APPEND ZM_BIN_LIBS "${AVFORMAT_LIBRARIES}") if(AVFORMAT_INCLUDE_DIR)
find_path(AVFORMAT_INCLUDE_DIR "libavformat/avformat.h" /usr/include/ffmpeg) include_directories("${AVFORMAT_INCLUDE_DIR}")
if(AVFORMAT_INCLUDE_DIR) set(CMAKE_REQUIRED_INCLUDES "${AVFORMAT_INCLUDE_DIR}")
include_directories("${AVFORMAT_INCLUDE_DIR}") endif(AVFORMAT_INCLUDE_DIR)
set(CMAKE_REQUIRED_INCLUDES "${AVFORMAT_INCLUDE_DIR}") mark_as_advanced(FORCE AVFORMAT_LIBRARIES AVFORMAT_INCLUDE_DIR)
endif(AVFORMAT_INCLUDE_DIR) check_include_file("libavformat/avformat.h" HAVE_LIBAVFORMAT_AVFORMAT_H)
mark_as_advanced(FORCE AVFORMAT_LIBRARIES AVFORMAT_INCLUDE_DIR) set(optlibsfound "${optlibsfound} AVFormat")
check_include_file("libavformat/avformat.h" HAVE_LIBAVFORMAT_AVFORMAT_H) else(AVFORMAT_LIBRARIES)
set(optlibsfound "${optlibsfound} AVFormat") set(optlibsnotfound "${optlibsnotfound} AVFormat")
else(AVFORMAT_LIBRARIES) endif(AVFORMAT_LIBRARIES)
set(optlibsnotfound "${optlibsnotfound} AVFormat")
endif(AVFORMAT_LIBRARIES)
# avcodec (using find_library and find_path) # avcodec (using find_library and find_path)
find_library(AVCODEC_LIBRARIES avcodec) find_library(AVCODEC_LIBRARIES avcodec)
if(AVCODEC_LIBRARIES) if(AVCODEC_LIBRARIES)
set(HAVE_LIBAVCODEC 1) set(HAVE_LIBAVCODEC 1)
list(APPEND ZM_BIN_LIBS "${AVCODEC_LIBRARIES}") list(APPEND ZM_BIN_LIBS "${AVCODEC_LIBRARIES}")
find_path(AVCODEC_INCLUDE_DIR "libavcodec/avcodec.h" /usr/include/ffmpeg) find_path(AVCODEC_INCLUDE_DIR "libavcodec/avcodec.h" /usr/include/ffmpeg)
if(AVCODEC_INCLUDE_DIR) if(AVCODEC_INCLUDE_DIR)
include_directories("${AVCODEC_INCLUDE_DIR}") include_directories("${AVCODEC_INCLUDE_DIR}")
set(CMAKE_REQUIRED_INCLUDES "${AVCODEC_INCLUDE_DIR}") set(CMAKE_REQUIRED_INCLUDES "${AVCODEC_INCLUDE_DIR}")
endif(AVCODEC_INCLUDE_DIR) endif(AVCODEC_INCLUDE_DIR)
mark_as_advanced(FORCE AVCODEC_LIBRARIES AVCODEC_INCLUDE_DIR) mark_as_advanced(FORCE AVCODEC_LIBRARIES AVCODEC_INCLUDE_DIR)
check_include_file("libavcodec/avcodec.h" HAVE_LIBAVCODEC_AVCODEC_H) check_include_file("libavcodec/avcodec.h" HAVE_LIBAVCODEC_AVCODEC_H)
set(optlibsfound "${optlibsfound} AVCodec") set(optlibsfound "${optlibsfound} AVCodec")
else(AVCODEC_LIBRARIES) else(AVCODEC_LIBRARIES)
set(optlibsnotfound "${optlibsnotfound} AVCodec") set(optlibsnotfound "${optlibsnotfound} AVCodec")
endif(AVCODEC_LIBRARIES) endif(AVCODEC_LIBRARIES)
# avdevice (using find_library and find_path) # avdevice (using find_library and find_path)
find_library(AVDEVICE_LIBRARIES avdevice) find_library(AVDEVICE_LIBRARIES avdevice)
if(AVDEVICE_LIBRARIES) if(AVDEVICE_LIBRARIES)
set(HAVE_LIBAVDEVICE 1) set(HAVE_LIBAVDEVICE 1)
list(APPEND ZM_BIN_LIBS "${AVDEVICE_LIBRARIES}") list(APPEND ZM_BIN_LIBS "${AVDEVICE_LIBRARIES}")
find_path(AVDEVICE_INCLUDE_DIR "libavdevice/avdevice.h" /usr/include/ffmpeg) find_path(AVDEVICE_INCLUDE_DIR "libavdevice/avdevice.h" /usr/include/ffmpeg)
if(AVDEVICE_INCLUDE_DIR) if(AVDEVICE_INCLUDE_DIR)
include_directories("${AVDEVICE_INCLUDE_DIR}") include_directories("${AVDEVICE_INCLUDE_DIR}")
set(CMAKE_REQUIRED_INCLUDES "${AVDEVICE_INCLUDE_DIR}") set(CMAKE_REQUIRED_INCLUDES "${AVDEVICE_INCLUDE_DIR}")
endif(AVDEVICE_INCLUDE_DIR) endif(AVDEVICE_INCLUDE_DIR)
mark_as_advanced(FORCE AVDEVICE_LIBRARIES AVDEVICE_INCLUDE_DIR) mark_as_advanced(FORCE AVDEVICE_LIBRARIES AVDEVICE_INCLUDE_DIR)
check_include_file("libavdevice/avdevice.h" HAVE_LIBAVDEVICE_AVDEVICE_H) check_include_file("libavdevice/avdevice.h" HAVE_LIBAVDEVICE_AVDEVICE_H)
set(optlibsfound "${optlibsfound} AVDevice") set(optlibsfound "${optlibsfound} AVDevice")
else(AVDEVICE_LIBRARIES) else(AVDEVICE_LIBRARIES)
set(optlibsnotfound "${optlibsnotfound} AVDevice") set(optlibsnotfound "${optlibsnotfound} AVDevice")
endif(AVDEVICE_LIBRARIES) endif(AVDEVICE_LIBRARIES)
# avutil (using find_library and find_path) # avutil (using find_library and find_path)
find_library(AVUTIL_LIBRARIES avutil) find_library(AVUTIL_LIBRARIES avutil)
if(AVUTIL_LIBRARIES) if(AVUTIL_LIBRARIES)
set(HAVE_LIBAVUTIL 1) set(HAVE_LIBAVUTIL 1)
list(APPEND ZM_BIN_LIBS "${AVUTIL_LIBRARIES}") list(APPEND ZM_BIN_LIBS "${AVUTIL_LIBRARIES}")
find_path(AVUTIL_INCLUDE_DIR "libavutil/avutil.h" /usr/include/ffmpeg) find_path(AVUTIL_INCLUDE_DIR "libavutil/avutil.h" /usr/include/ffmpeg)
if(AVUTIL_INCLUDE_DIR) if(AVUTIL_INCLUDE_DIR)
include_directories("${AVUTIL_INCLUDE_DIR}") include_directories("${AVUTIL_INCLUDE_DIR}")
set(CMAKE_REQUIRED_INCLUDES "${AVUTIL_INCLUDE_DIR}") set(CMAKE_REQUIRED_INCLUDES "${AVUTIL_INCLUDE_DIR}")
endif(AVUTIL_INCLUDE_DIR) endif(AVUTIL_INCLUDE_DIR)
mark_as_advanced(FORCE AVUTIL_LIBRARIES AVUTIL_INCLUDE_DIR) mark_as_advanced(FORCE AVUTIL_LIBRARIES AVUTIL_INCLUDE_DIR)
check_include_file("libavutil/avutil.h" HAVE_LIBAVUTIL_AVUTIL_H) check_include_file("libavutil/avutil.h" HAVE_LIBAVUTIL_AVUTIL_H)
check_include_file("libavutil/mathematics.h" HAVE_LIBAVUTIL_MATHEMATICS_H) check_include_file("libavutil/mathematics.h" HAVE_LIBAVUTIL_MATHEMATICS_H)
check_include_file("libavutil/hwcontext.h" HAVE_LIBAVUTIL_HWCONTEXT_H) check_include_file("libavutil/hwcontext.h" HAVE_LIBAVUTIL_HWCONTEXT_H)
set(optlibsfound "${optlibsfound} AVUtil") set(optlibsfound "${optlibsfound} AVUtil")
else(AVUTIL_LIBRARIES) else(AVUTIL_LIBRARIES)
set(optlibsnotfound "${optlibsnotfound} AVUtil") set(optlibsnotfound "${optlibsnotfound} AVUtil")
endif(AVUTIL_LIBRARIES) endif(AVUTIL_LIBRARIES)
# swscale (using find_library and find_path) # swscale (using find_library and find_path)
find_library(SWSCALE_LIBRARIES swscale) find_library(SWSCALE_LIBRARIES swscale)
if(SWSCALE_LIBRARIES) if(SWSCALE_LIBRARIES)
set(HAVE_LIBSWSCALE 1) set(HAVE_LIBSWSCALE 1)
list(APPEND ZM_BIN_LIBS "${SWSCALE_LIBRARIES}") list(APPEND ZM_BIN_LIBS "${SWSCALE_LIBRARIES}")
find_path(SWSCALE_INCLUDE_DIR "libswscale/swscale.h" /usr/include/ffmpeg) find_path(SWSCALE_INCLUDE_DIR "libswscale/swscale.h" /usr/include/ffmpeg)
if(SWSCALE_INCLUDE_DIR) if(SWSCALE_INCLUDE_DIR)
include_directories("${SWSCALE_INCLUDE_DIR}") include_directories("${SWSCALE_INCLUDE_DIR}")
set(CMAKE_REQUIRED_INCLUDES "${SWSCALE_INCLUDE_DIR}") set(CMAKE_REQUIRED_INCLUDES "${SWSCALE_INCLUDE_DIR}")
endif(SWSCALE_INCLUDE_DIR) endif(SWSCALE_INCLUDE_DIR)
mark_as_advanced(FORCE SWSCALE_LIBRARIES SWSCALE_INCLUDE_DIR) mark_as_advanced(FORCE SWSCALE_LIBRARIES SWSCALE_INCLUDE_DIR)
check_include_file("libswscale/swscale.h" HAVE_LIBSWSCALE_SWSCALE_H) check_include_file("libswscale/swscale.h" HAVE_LIBSWSCALE_SWSCALE_H)
set(optlibsfound "${optlibsfound} SWScale") set(optlibsfound "${optlibsfound} SWScale")
else(SWSCALE_LIBRARIES) else(SWSCALE_LIBRARIES)
set(optlibsnotfound "${optlibsnotfound} SWScale") set(optlibsnotfound "${optlibsnotfound} SWScale")
endif(SWSCALE_LIBRARIES) endif(SWSCALE_LIBRARIES)
# SWresample (using find_library and find_path) # SWresample (using find_library and find_path)
find_library(SWRESAMPLE_LIBRARIES swresample) find_library(SWRESAMPLE_LIBRARIES swresample)
if(SWRESAMPLE_LIBRARIES) if(SWRESAMPLE_LIBRARIES)
set(HAVE_LIBSWRESAMPLE 1) set(HAVE_LIBSWRESAMPLE 1)
list(APPEND ZM_BIN_LIBS "${SWRESAMPLE_LIBRARIES}") list(APPEND ZM_BIN_LIBS "${SWRESAMPLE_LIBRARIES}")
find_path(SWRESAMPLE_INCLUDE_DIR "libswresample/swresample.h" /usr/include/ffmpeg) find_path(SWRESAMPLE_INCLUDE_DIR "libswresample/swresample.h" /usr/include/ffmpeg)
if(SWRESAMPLE_INCLUDE_DIR) if(SWRESAMPLE_INCLUDE_DIR)
include_directories("${SWRESAMPLE_INCLUDE_DIR}") include_directories("${SWRESAMPLE_INCLUDE_DIR}")
set(CMAKE_REQUIRED_INCLUDES "${SWRESAMPLE_INCLUDE_DIR}") set(CMAKE_REQUIRED_INCLUDES "${SWRESAMPLE_INCLUDE_DIR}")
endif(SWRESAMPLE_INCLUDE_DIR) endif(SWRESAMPLE_INCLUDE_DIR)
mark_as_advanced(FORCE SWRESAMPLE_LIBRARIES SWRESAMPLE_INCLUDE_DIR) mark_as_advanced(FORCE SWRESAMPLE_LIBRARIES SWRESAMPLE_INCLUDE_DIR)
check_include_file("libswresample/swresample.h" HAVE_LIBSWRESAMPLE_SWRESAMPLE_H) check_include_file("libswresample/swresample.h" HAVE_LIBSWRESAMPLE_SWRESAMPLE_H)
set(optlibsfound "${optlibsfound} SWResample") set(optlibsfound "${optlibsfound} SWResample")
else(SWRESAMPLE_LIBRARIES) else(SWRESAMPLE_LIBRARIES)
set(optlibsnotfound "${optlibsnotfound} SWResample") set(optlibsnotfound "${optlibsnotfound} SWResample")
# AVresample (using find_library and find_path) # AVresample (using find_library and find_path)
find_library(AVRESAMPLE_LIBRARIES avresample) find_library(AVRESAMPLE_LIBRARIES avresample)
if(AVRESAMPLE_LIBRARIES) if(AVRESAMPLE_LIBRARIES)
set(HAVE_LIBAVRESAMPLE 1) set(HAVE_LIBAVRESAMPLE 1)
list(APPEND ZM_BIN_LIBS "${AVRESAMPLE_LIBRARIES}") list(APPEND ZM_BIN_LIBS "${AVRESAMPLE_LIBRARIES}")
find_path(AVRESAMPLE_INCLUDE_DIR "libavresample/avresample.h" /usr/include/ffmpeg) find_path(AVRESAMPLE_INCLUDE_DIR "libavresample/avresample.h" /usr/include/ffmpeg)
if(AVRESAMPLE_INCLUDE_DIR) if(AVRESAMPLE_INCLUDE_DIR)
include_directories("${AVRESAMPLE_INCLUDE_DIR}") include_directories("${AVRESAMPLE_INCLUDE_DIR}")
set(CMAKE_REQUIRED_INCLUDES "${AVRESAMPLE_INCLUDE_DIR}") set(CMAKE_REQUIRED_INCLUDES "${AVRESAMPLE_INCLUDE_DIR}")
endif(AVRESAMPLE_INCLUDE_DIR) endif(AVRESAMPLE_INCLUDE_DIR)
mark_as_advanced(FORCE AVRESAMPLE_LIBRARIES AVRESAMPLE_INCLUDE_DIR) mark_as_advanced(FORCE AVRESAMPLE_LIBRARIES AVRESAMPLE_INCLUDE_DIR)
check_include_file("libavresample/avresample.h" HAVE_LIBAVRESAMPLE_AVRESAMPLE_H) check_include_file("libavresample/avresample.h" HAVE_LIBAVRESAMPLE_AVRESAMPLE_H)
set(optlibsfound "${optlibsfound} AVResample") set(optlibsfound "${optlibsfound} AVResample")
else(AVRESAMPLE_LIBRARIES) else(AVRESAMPLE_LIBRARIES)
set(optlibsnotfound "${optlibsnotfound} AVResample") set(optlibsnotfound "${optlibsnotfound} AVResample")
endif(AVRESAMPLE_LIBRARIES) endif(AVRESAMPLE_LIBRARIES)
endif(SWRESAMPLE_LIBRARIES) endif(SWRESAMPLE_LIBRARIES)
# Find the path to the ffmpeg executable # Find the path to the ffmpeg executable
find_program(FFMPEG_EXECUTABLE find_program(FFMPEG_EXECUTABLE
NAMES ffmpeg avconv NAMES ffmpeg avconv
PATH_SUFFIXES ffmpeg) PATH_SUFFIXES ffmpeg)
if(FFMPEG_EXECUTABLE) if(FFMPEG_EXECUTABLE)
set(PATH_FFMPEG "${FFMPEG_EXECUTABLE}") set(PATH_FFMPEG "${FFMPEG_EXECUTABLE}")
set(OPT_FFMPEG "yes") set(OPT_FFMPEG "yes")
mark_as_advanced(FFMPEG_EXECUTABLE) mark_as_advanced(FFMPEG_EXECUTABLE)
endif(FFMPEG_EXECUTABLE) endif(FFMPEG_EXECUTABLE)
endif(NOT ZM_NO_FFMPEG)
# Do not check for libvlc if ZM_NO_LIBVLC is on # Do not check for libvlc if ZM_NO_LIBVLC is on
if(NOT ZM_NO_LIBVLC) if(NOT ZM_NO_LIBVLC)

View File

@ -62,7 +62,6 @@ Advanced:
ZM_EXTRA_LIBS A list of optional libraries, separated by semicolons, e.g. ssl;theora ZM_EXTRA_LIBS A list of optional libraries, separated by semicolons, e.g. ssl;theora
ZM_MYSQL_ENGINE MySQL engine to use with database, default: InnoDB ZM_MYSQL_ENGINE MySQL engine to use with database, default: InnoDB
ZM_NO_MMAP Set to ON to not use mmap shared memory. Shouldn't be enabled unless you experience problems with the shared memory. default: OFF ZM_NO_MMAP Set to ON to not use mmap shared memory. Shouldn't be enabled unless you experience problems with the shared memory. default: OFF
ZM_NO_FFMPEG Set to ON to skip ffmpeg checks and force building ZM without ffmpeg. default: OFF
ZM_NO_X10 Set to ON to build ZoneMinder without X10 support. default: OFF ZM_NO_X10 Set to ON to build ZoneMinder without X10 support. default: OFF
ZM_PERL_MM_PARMS 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 MakeMaker documentation for a definition of acceptable parameters. If you set this to something that causes the modules to be installed outside Perl's normal serach path, then you will also need to set ZM_PERL_SEARCH_PATH accordingly. default: "INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1" ZM_PERL_MM_PARMS 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 MakeMaker documentation for a definition of acceptable parameters. If you set this to something that causes the modules to be installed outside Perl's normal serach path, then you will also need to set ZM_PERL_SEARCH_PATH accordingly. default: "INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1"
ZM_PERL_SEARCH_PATH Use to add a folder to your Perl's search path. This will need to be set in cases where ZM_PERL_MM_PARMS has been modified such that ZoneMinder's Perl modules are installed outside Perl's default search path. default: "" ZM_PERL_SEARCH_PATH Use to add a folder to your Perl's search path. This will need to be set in cases where ZM_PERL_MM_PARMS has been modified such that ZoneMinder's Perl modules are installed outside Perl's default search path. default: ""