|
|
@ -10,28 +10,22 @@ set(zoneminder_API_VERSION "${zoneminder_VERSION}.1")
|
|
|
|
|
|
|
|
|
|
|
|
# Make sure the submodules are there
|
|
|
|
# Make sure the submodules are there
|
|
|
|
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/web/api/app/Plugin/Crud/Lib/CrudControllerTrait.php")
|
|
|
|
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/web/api/app/Plugin/Crud/Lib/CrudControllerTrait.php")
|
|
|
|
message( SEND_ERROR "The git submodules are not available. Please run
|
|
|
|
message(SEND_ERROR "The git submodules are not available. Please run git submodule update --init --recursive")
|
|
|
|
git submodule update --init --recursive")
|
|
|
|
endif()
|
|
|
|
endif( NOT EXISTS "${CMAKE_SOURCE_DIR}/web/api/app/Plugin/Crud/Lib/CrudControllerTrait.php" )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# CMake does not allow out-of-source build if CMakeCache.exists
|
|
|
|
# CMake does not allow out-of-source build if CMakeCache.exists
|
|
|
|
# in the source folder. Abort and notify the user
|
|
|
|
# in the source folder. Abort and notify the user
|
|
|
|
if(
|
|
|
|
if((NOT (CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR)) AND (EXISTS "${CMAKE_SOURCE_DIR}/CMakeCache.txt"))
|
|
|
|
(NOT (CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR))
|
|
|
|
|
|
|
|
AND (EXISTS "${CMAKE_SOURCE_DIR}/CMakeCache.txt"))
|
|
|
|
|
|
|
|
message(FATAL_ERROR " You are attempting to do an out-of-source build,
|
|
|
|
message(FATAL_ERROR " You are attempting to do an out-of-source build,
|
|
|
|
but a cmake cache file for an in-source build exists. Please delete
|
|
|
|
but a cmake cache file for an in-source build exists. Please delete
|
|
|
|
the file CMakeCache.txt from the source folder to proceed.")
|
|
|
|
the file CMakeCache.txt from the source folder to proceed.")
|
|
|
|
endif(
|
|
|
|
endif()
|
|
|
|
(NOT (CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR))
|
|
|
|
|
|
|
|
AND (EXISTS "${CMAKE_SOURCE_DIR}/CMakeCache.txt"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Default build type. To change the build type,
|
|
|
|
# Default build type. To change the build type,
|
|
|
|
# use the CMAKE_BUILD_TYPE configuration option.
|
|
|
|
# use the CMAKE_BUILD_TYPE configuration option.
|
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
|
|
set(CMAKE_BUILD_TYPE
|
|
|
|
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type: Release or Debug" FORCE)
|
|
|
|
Release CACHE STRING "Build type: Release or Debug" FORCE)
|
|
|
|
endif()
|
|
|
|
endif(NOT CMAKE_BUILD_TYPE)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Can assist in troubleshooting
|
|
|
|
# Can assist in troubleshooting
|
|
|
|
#set(CMAKE_VERBOSE_MAKEFILE ON)
|
|
|
|
#set(CMAKE_VERBOSE_MAKEFILE ON)
|
|
|
@ -41,25 +35,26 @@ endif(NOT CMAKE_BUILD_TYPE)
|
|
|
|
set(HOST_OS "")
|
|
|
|
set(HOST_OS "")
|
|
|
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
|
|
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
|
|
|
set(HOST_OS "linux")
|
|
|
|
set(HOST_OS "linux")
|
|
|
|
endif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
|
|
|
endif()
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES ".*(SunOS|Solaris).*")
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES ".*(SunOS|Solaris).*")
|
|
|
|
set(HOST_OS "solaris")
|
|
|
|
set(HOST_OS "solaris")
|
|
|
|
set(SOLARIS 1)
|
|
|
|
set(SOLARIS 1)
|
|
|
|
endif(${CMAKE_SYSTEM_NAME} MATCHES ".*(SunOS|Solaris).*")
|
|
|
|
endif()
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES ".*BSD.*")
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES ".*BSD.*")
|
|
|
|
set(HOST_OS "BSD")
|
|
|
|
set(HOST_OS "BSD")
|
|
|
|
set(BSD 1)
|
|
|
|
set(BSD 1)
|
|
|
|
endif(${CMAKE_SYSTEM_NAME} MATCHES ".*BSD.*")
|
|
|
|
endif()
|
|
|
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
|
|
|
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
|
|
|
|
set(HOST_OS "darwin")
|
|
|
|
set(HOST_OS "darwin")
|
|
|
|
endif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
|
|
|
|
endif()
|
|
|
|
if(NOT HOST_OS)
|
|
|
|
if(NOT HOST_OS)
|
|
|
|
message(FATAL_ERROR
|
|
|
|
message(FATAL_ERROR
|
|
|
|
"ZoneMinder was unable to deterimine the host OS. Please report this. Value of CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")
|
|
|
|
"ZoneMinder was unable to deterimine the host OS. Please report this.
|
|
|
|
endif(NOT HOST_OS)
|
|
|
|
Value of CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
|
|
|
# Default CLFAGS and CXXFLAGS:
|
|
|
|
# Default CLFAGS and CXXFLAGS:
|
|
|
|
set(CMAKE_C_FLAGS_RELEASE "-Wall -D__STDC_CONSTANT_MACROS -O2")
|
|
|
|
set(CMAKE_C_FLAGS_RELEASE "-Wall -D__STDC_CONSTANT_MACROS -O2")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "-Wall -D__STDC_CONSTANT_MACROS -O2")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "-Wall -D__STDC_CONSTANT_MACROS -O2")
|
|
|
@ -77,36 +72,35 @@ set (CMAKE_CXX_STANDARD 11)
|
|
|
|
# because passing -fmpu=neon is unsafe to processors that don't support neon
|
|
|
|
# because passing -fmpu=neon is unsafe to processors that don't support neon
|
|
|
|
|
|
|
|
|
|
|
|
# Arm neon support only tested on Linux. If your arm hardware is running a non-Linux distro and is using gcc then contact us.
|
|
|
|
# Arm neon support only tested on Linux. If your arm hardware is running a non-Linux distro and is using gcc then contact us.
|
|
|
|
IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
|
|
|
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" ZM_SYSTEM_PROC)
|
|
|
|
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" ZM_SYSTEM_PROC)
|
|
|
|
IF((ZM_SYSTEM_PROC STREQUAL "") OR (ZM_SYSTEM_PROC STREQUAL "unknown"))
|
|
|
|
if((ZM_SYSTEM_PROC STREQUAL "") OR (ZM_SYSTEM_PROC STREQUAL "unknown"))
|
|
|
|
execute_process(COMMAND uname -m OUTPUT_VARIABLE ZM_SYSTEM_PROC ERROR_VARIABLE ZM_SYSTEM_PROC_ERR)
|
|
|
|
execute_process(COMMAND uname -m OUTPUT_VARIABLE ZM_SYSTEM_PROC ERROR_VARIABLE ZM_SYSTEM_PROC_ERR)
|
|
|
|
|
|
|
|
|
|
|
|
# maybe make the following error checks fatal
|
|
|
|
# maybe make the following error checks fatal
|
|
|
|
IF(ZM_SYSTEM_PROC_ERR)
|
|
|
|
if(ZM_SYSTEM_PROC_ERR)
|
|
|
|
message(WARNING "\nAn error occurred while attempting to determine the system processor:\n${ZM_SYSTEM_PROC_ERR}")
|
|
|
|
message(WARNING "\nAn error occurred while attempting to determine the system processor:\n${ZM_SYSTEM_PROC_ERR}")
|
|
|
|
ENDIF(ZM_SYSTEM_PROC_ERR)
|
|
|
|
endif()
|
|
|
|
IF(NOT ZM_SYSTEM_PROC)
|
|
|
|
if(NOT ZM_SYSTEM_PROC)
|
|
|
|
message(WARNING "\nUnable to determine the system processor. This may cause a build failure.\n")
|
|
|
|
message(WARNING "\nUnable to determine the system processor. This may cause a build failure.\n")
|
|
|
|
ENDIF(ZM_SYSTEM_PROC)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
ENDIF((ZM_SYSTEM_PROC STREQUAL "") OR (ZM_SYSTEM_PROC STREQUAL "unknown"))
|
|
|
|
if(ZM_SYSTEM_PROC MATCHES "^arm")
|
|
|
|
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)
|
|
|
|
IF(ZM_SYSTEM_PROC MATCHES "^arm")
|
|
|
|
exec_program(grep ARGS " neon " "/proc/cpuinfo" OUTPUT_VARIABLE neonoutput RETURN_VALUE neonresult)
|
|
|
|
IF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)
|
|
|
|
if(neonresult EQUAL 0)
|
|
|
|
EXEC_PROGRAM(grep ARGS " neon " "/proc/cpuinfo" OUTPUT_VARIABLE neonoutput RETURN_VALUE neonresult)
|
|
|
|
|
|
|
|
IF(neonresult EQUAL 0)
|
|
|
|
|
|
|
|
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -mfpu=neon")
|
|
|
|
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -mfpu=neon")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -mfpu=neon")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -mfpu=neon")
|
|
|
|
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -mfpu=neon")
|
|
|
|
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -mfpu=neon")
|
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -mfpu=neon")
|
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -mfpu=neon")
|
|
|
|
ELSE(neonresult EQUAL 0)
|
|
|
|
else()
|
|
|
|
add_definitions(-DZM_STRIP_NEON=1)
|
|
|
|
add_definitions(-DZM_STRIP_NEON=1)
|
|
|
|
message(STATUS "ARM Neon is not available on this processor. Neon functions will be absent")
|
|
|
|
message(STATUS "ARM Neon is not available on this processor. Neon functions will be absent")
|
|
|
|
ENDIF(neonresult EQUAL 0)
|
|
|
|
endif()
|
|
|
|
ENDIF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)
|
|
|
|
endif()
|
|
|
|
ENDIF(ZM_SYSTEM_PROC MATCHES "^arm")
|
|
|
|
endif()
|
|
|
|
ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# Modules that we need:
|
|
|
|
# Modules that we need:
|
|
|
|
include(GNUInstallDirs)
|
|
|
|
include(GNUInstallDirs)
|
|
|
@ -260,7 +254,7 @@ elseif(ZM_TARGET_DISTRO STREQUAL "FreeBSD")
|
|
|
|
set(ZM_WEBDIR "/usr/local/share/zoneminder/www")
|
|
|
|
set(ZM_WEBDIR "/usr/local/share/zoneminder/www")
|
|
|
|
set(ZM_CGIDIR "/usr/local/libexec/zoneminder/cgi-bin")
|
|
|
|
set(ZM_CGIDIR "/usr/local/libexec/zoneminder/cgi-bin")
|
|
|
|
set(ZM_PERL_MM_PARMS "INSTALLDIRS=site")
|
|
|
|
set(ZM_PERL_MM_PARMS "INSTALLDIRS=site")
|
|
|
|
endif((ZM_TARGET_DISTRO MATCHES "^el") OR (ZM_TARGET_DISTRO MATCHES "^fc"))
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
if(BUILD_MAN)
|
|
|
|
if(BUILD_MAN)
|
|
|
|
message(STATUS "Building man pages: Yes (default)")
|
|
|
|
message(STATUS "Building man pages: Yes (default)")
|
|
|
@ -270,12 +264,10 @@ else()
|
|
|
|
list(APPEND ZM_PERL_MM_PARMS_FULL ${ZM_PERL_MM_PARMS}
|
|
|
|
list(APPEND ZM_PERL_MM_PARMS_FULL ${ZM_PERL_MM_PARMS}
|
|
|
|
"INSTALLMAN1DIR=none"
|
|
|
|
"INSTALLMAN1DIR=none"
|
|
|
|
"INSTALLMAN3DIR=none")
|
|
|
|
"INSTALLMAN3DIR=none")
|
|
|
|
endif(BUILD_MAN)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# Required for certain checks to work
|
|
|
|
# Required for certain checks to work
|
|
|
|
set(CMAKE_EXTRA_INCLUDE_FILES
|
|
|
|
set(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES} stdio.h stdlib.h math.h signal.h)
|
|
|
|
${CMAKE_EXTRA_INCLUDE_FILES} stdio.h stdlib.h math.h signal.h
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
# Required for including headers from the this folder
|
|
|
|
# Required for including headers from the this folder
|
|
|
|
include_directories("${CMAKE_BINARY_DIR}")
|
|
|
|
include_directories("${CMAKE_BINARY_DIR}")
|
|
|
|
# This is required to enable searching in lib64 (if exists), do not change
|
|
|
|
# This is required to enable searching in lib64 (if exists), do not change
|
|
|
@ -284,13 +276,13 @@ set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ON)
|
|
|
|
# Set the systemd flag if systemd is autodetected or ZM_SYSTEMD has been set
|
|
|
|
# Set the systemd flag if systemd is autodetected or ZM_SYSTEMD has been set
|
|
|
|
if(ZM_SYSTEMD OR (IS_DIRECTORY /usr/lib/systemd/system) OR (IS_DIRECTORY /lib/systemd/system))
|
|
|
|
if(ZM_SYSTEMD OR (IS_DIRECTORY /usr/lib/systemd/system) OR (IS_DIRECTORY /lib/systemd/system))
|
|
|
|
set(WITH_SYSTEMD 1)
|
|
|
|
set(WITH_SYSTEMD 1)
|
|
|
|
endif(ZM_SYSTEMD OR (IS_DIRECTORY /usr/lib/systemd/system) OR (IS_DIRECTORY /lib/systemd/system))
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# System checks
|
|
|
|
# System checks
|
|
|
|
check_include_file("libv4l1-videodev.h" HAVE_LIBV4L1_VIDEODEV_H)
|
|
|
|
check_include_file("libv4l1-videodev.h" HAVE_LIBV4L1_VIDEODEV_H)
|
|
|
|
if(NOT HAVE_LIBV4L1_VIDEODEV_H)
|
|
|
|
if(NOT HAVE_LIBV4L1_VIDEODEV_H)
|
|
|
|
check_include_file("linux/videodev.h" HAVE_LINUX_VIDEODEV_H)
|
|
|
|
check_include_file("linux/videodev.h" HAVE_LINUX_VIDEODEV_H)
|
|
|
|
endif(NOT HAVE_LIBV4L1_VIDEODEV_H)
|
|
|
|
endif()
|
|
|
|
check_include_file("linux/videodev2.h" HAVE_LINUX_VIDEODEV2_H)
|
|
|
|
check_include_file("linux/videodev2.h" HAVE_LINUX_VIDEODEV2_H)
|
|
|
|
check_include_file("execinfo.h" HAVE_EXECINFO_H)
|
|
|
|
check_include_file("execinfo.h" HAVE_EXECINFO_H)
|
|
|
|
if(HAVE_EXECINFO_H)
|
|
|
|
if(HAVE_EXECINFO_H)
|
|
|
@ -299,10 +291,10 @@ if (HAVE_EXECINFO_H)
|
|
|
|
find_library(EXECINFO_LIBRARY NAMES execinfo)
|
|
|
|
find_library(EXECINFO_LIBRARY NAMES execinfo)
|
|
|
|
if(EXECINFO_LIBRARY)
|
|
|
|
if(EXECINFO_LIBRARY)
|
|
|
|
list(APPEND ZM_BIN_LIBS "-lexecinfo")
|
|
|
|
list(APPEND ZM_BIN_LIBS "-lexecinfo")
|
|
|
|
endif (EXECINFO_LIBRARY)
|
|
|
|
endif()
|
|
|
|
endif (NOT HAVE_DECL_BACKTRACE)
|
|
|
|
endif()
|
|
|
|
check_function_exists("backtrace_symbols" HAVE_DECL_BACKTRACE_SYMBOLS)
|
|
|
|
check_function_exists("backtrace_symbols" HAVE_DECL_BACKTRACE_SYMBOLS)
|
|
|
|
endif (HAVE_EXECINFO_H)
|
|
|
|
endif()
|
|
|
|
check_include_file("ucontext.h" HAVE_UCONTEXT_H)
|
|
|
|
check_include_file("ucontext.h" HAVE_UCONTEXT_H)
|
|
|
|
check_include_file("sys/sendfile.h" HAVE_SYS_SENDFILE_H)
|
|
|
|
check_include_file("sys/sendfile.h" HAVE_SYS_SENDFILE_H)
|
|
|
|
check_include_file("sys/syscall.h" HAVE_SYS_SYSCALL_H)
|
|
|
|
check_include_file("sys/syscall.h" HAVE_SYS_SYSCALL_H)
|
|
|
@ -319,10 +311,10 @@ if (UNIX)
|
|
|
|
CHECK_LIBRARY_EXISTS(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME)
|
|
|
|
CHECK_LIBRARY_EXISTS(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME)
|
|
|
|
if(NOT HAVE_CLOCK_GETTIME)
|
|
|
|
if(NOT HAVE_CLOCK_GETTIME)
|
|
|
|
message(FATAL_ERROR "clock_gettime not found")
|
|
|
|
message(FATAL_ERROR "clock_gettime not found")
|
|
|
|
else(NOT HAVE_CLOCK_GETTIME)
|
|
|
|
else()
|
|
|
|
list(APPEND ZM_BIN_LIBS "-lrt")
|
|
|
|
list(APPEND ZM_BIN_LIBS "-lrt")
|
|
|
|
endif(NOT HAVE_CLOCK_GETTIME)
|
|
|
|
endif()
|
|
|
|
endif(UNIX)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# zlib
|
|
|
|
# zlib
|
|
|
|
find_package(ZLIB)
|
|
|
|
find_package(ZLIB)
|
|
|
@ -333,9 +325,9 @@ if(ZLIB_FOUND)
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES "${ZLIB_INCLUDE_DIR}")
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES "${ZLIB_INCLUDE_DIR}")
|
|
|
|
check_include_file("zlib.h" HAVE_ZLIB_H)
|
|
|
|
check_include_file("zlib.h" HAVE_ZLIB_H)
|
|
|
|
set(optlibsfound "${optlibsfound} zlib")
|
|
|
|
set(optlibsfound "${optlibsfound} zlib")
|
|
|
|
else(ZLIB_FOUND)
|
|
|
|
else()
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} zlib")
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} zlib")
|
|
|
|
endif(ZLIB_FOUND)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# Do not check for cURL if ZM_NO_CURL is on
|
|
|
|
# Do not check for cURL if ZM_NO_CURL is on
|
|
|
|
if(NOT ZM_NO_CURL)
|
|
|
|
if(NOT ZM_NO_CURL)
|
|
|
@ -348,10 +340,10 @@ if(NOT ZM_NO_CURL)
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES ${CURL_INCLUDE_DIRS})
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES ${CURL_INCLUDE_DIRS})
|
|
|
|
check_include_file("curl/curl.h" HAVE_CURL_CURL_H)
|
|
|
|
check_include_file("curl/curl.h" HAVE_CURL_CURL_H)
|
|
|
|
set(optlibsfound "${optlibsfound} cURL")
|
|
|
|
set(optlibsfound "${optlibsfound} cURL")
|
|
|
|
else(CURL_FOUND)
|
|
|
|
else()
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} cURL")
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} cURL")
|
|
|
|
endif(CURL_FOUND)
|
|
|
|
endif()
|
|
|
|
endif(NOT ZM_NO_CURL)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# jpeg
|
|
|
|
# jpeg
|
|
|
|
find_package(JPEG)
|
|
|
|
find_package(JPEG)
|
|
|
@ -365,11 +357,11 @@ if(JPEG_FOUND)
|
|
|
|
if(NOT HAVE_JPEGLIB_H)
|
|
|
|
if(NOT HAVE_JPEGLIB_H)
|
|
|
|
message(FATAL_ERROR
|
|
|
|
message(FATAL_ERROR
|
|
|
|
"ZoneMinder requires libjpeg headers - check that libjpeg development packages are installed")
|
|
|
|
"ZoneMinder requires libjpeg headers - check that libjpeg development packages are installed")
|
|
|
|
endif(NOT HAVE_JPEGLIB_H)
|
|
|
|
endif()
|
|
|
|
else(JPEG_FOUND)
|
|
|
|
else()
|
|
|
|
message(FATAL_ERROR
|
|
|
|
message(FATAL_ERROR
|
|
|
|
"ZoneMinder requires jpeg but it was not found on your system")
|
|
|
|
"ZoneMinder requires jpeg but it was not found on your system")
|
|
|
|
endif(JPEG_FOUND)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# LIBJWT
|
|
|
|
# LIBJWT
|
|
|
|
find_package(LibJWT)
|
|
|
|
find_package(LibJWT)
|
|
|
@ -377,9 +369,9 @@ if(LIBJWT_FOUND)
|
|
|
|
set(HAVE_LIBJWT 1)
|
|
|
|
set(HAVE_LIBJWT 1)
|
|
|
|
set(optlibsfound "${optlibsfound} LIBJWT")
|
|
|
|
set(optlibsfound "${optlibsfound} LIBJWT")
|
|
|
|
list(APPEND ZM_BIN_LIBS "${LIBJWT_LIBRARY}")
|
|
|
|
list(APPEND ZM_BIN_LIBS "${LIBJWT_LIBRARY}")
|
|
|
|
else(LIBJWT_FOUND)
|
|
|
|
else()
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} LIBJWT")
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} LIBJWT")
|
|
|
|
endif(LIBJWT_FOUND)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# gnutls (using find_library and find_path)
|
|
|
|
# gnutls (using find_library and find_path)
|
|
|
|
if(HAVE_LIBJWT)
|
|
|
|
if(HAVE_LIBJWT)
|
|
|
@ -391,14 +383,14 @@ if(HAVE_LIBJWT)
|
|
|
|
if(GNUTLS_INCLUDE_DIR)
|
|
|
|
if(GNUTLS_INCLUDE_DIR)
|
|
|
|
include_directories("${GNUTLS_INCLUDE_DIR}")
|
|
|
|
include_directories("${GNUTLS_INCLUDE_DIR}")
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES "${GNUTLS_INCLUDE_DIR}")
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES "${GNUTLS_INCLUDE_DIR}")
|
|
|
|
endif(GNUTLS_INCLUDE_DIR)
|
|
|
|
endif()
|
|
|
|
mark_as_advanced(FORCE GNUTLS_LIBRARIES GNUTLS_INCLUDE_DIR)
|
|
|
|
mark_as_advanced(FORCE GNUTLS_LIBRARIES GNUTLS_INCLUDE_DIR)
|
|
|
|
check_include_file("gnutls/gnutls.h" HAVE_GNUTLS_GNUTLS_H)
|
|
|
|
check_include_file("gnutls/gnutls.h" HAVE_GNUTLS_GNUTLS_H)
|
|
|
|
set(optlibsfound "${optlibsfound} GnuTLS")
|
|
|
|
set(optlibsfound "${optlibsfound} GnuTLS")
|
|
|
|
else(GNUTLS_LIBRARIES)
|
|
|
|
else()
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} GnuTLS")
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} GnuTLS")
|
|
|
|
endif(GNUTLS_LIBRARIES)
|
|
|
|
endif()
|
|
|
|
endif(HAVE_LIBJWT)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# OpenSSL
|
|
|
|
# OpenSSL
|
|
|
|
if(NOT HAVE_LIBGNUTLS OR NOT HAVE_LIBJWT)
|
|
|
|
if(NOT HAVE_LIBGNUTLS OR NOT HAVE_LIBJWT)
|
|
|
@ -411,10 +403,10 @@ if(NOT HAVE_LIBGNUTLS OR NOT HAVE_LIBJWT)
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCLUDE_DIR}")
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES "${OPENSSL_INCLUDE_DIR}")
|
|
|
|
check_include_file("openssl/md5.h" HAVE_OPENSSL_MD5_H)
|
|
|
|
check_include_file("openssl/md5.h" HAVE_OPENSSL_MD5_H)
|
|
|
|
set(optlibsfound "${optlibsfound} OpenSSL")
|
|
|
|
set(optlibsfound "${optlibsfound} OpenSSL")
|
|
|
|
else(OPENSSL_FOUND)
|
|
|
|
else()
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} OpenSSL")
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} OpenSSL")
|
|
|
|
endif(OPENSSL_FOUND)
|
|
|
|
endif()
|
|
|
|
endif(NOT HAVE_LIBGNUTLS OR NOT HAVE_LIBJWT)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# pthread (using find_library and find_path)
|
|
|
|
# pthread (using find_library and find_path)
|
|
|
|
find_library(PTHREAD_LIBRARIES pthread)
|
|
|
|
find_library(PTHREAD_LIBRARIES pthread)
|
|
|
@ -425,17 +417,15 @@ if(PTHREAD_LIBRARIES)
|
|
|
|
if(PTHREAD_INCLUDE_DIR)
|
|
|
|
if(PTHREAD_INCLUDE_DIR)
|
|
|
|
include_directories("${PTHREAD_INCLUDE_DIR}")
|
|
|
|
include_directories("${PTHREAD_INCLUDE_DIR}")
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES "${PTHREAD_INCLUDE_DIR}")
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES "${PTHREAD_INCLUDE_DIR}")
|
|
|
|
endif(PTHREAD_INCLUDE_DIR)
|
|
|
|
endif()
|
|
|
|
mark_as_advanced(FORCE PTHREAD_LIBRARIES PTHREAD_INCLUDE_DIR)
|
|
|
|
mark_as_advanced(FORCE PTHREAD_LIBRARIES PTHREAD_INCLUDE_DIR)
|
|
|
|
check_include_file("pthread.h" HAVE_PTHREAD_H)
|
|
|
|
check_include_file("pthread.h" HAVE_PTHREAD_H)
|
|
|
|
if(NOT HAVE_PTHREAD_H)
|
|
|
|
if(NOT HAVE_PTHREAD_H)
|
|
|
|
message(FATAL_ERROR
|
|
|
|
message(FATAL_ERROR "ZoneMinder requires pthread headers - check that pthread development packages are installed")
|
|
|
|
"ZoneMinder requires pthread headers - check that pthread development packages are installed")
|
|
|
|
endif()
|
|
|
|
endif(NOT HAVE_PTHREAD_H)
|
|
|
|
else()
|
|
|
|
else(PTHREAD_LIBRARIES)
|
|
|
|
message(FATAL_ERROR "ZoneMinder requires pthread but it was not found on your system")
|
|
|
|
message(FATAL_ERROR
|
|
|
|
endif()
|
|
|
|
"ZoneMinder requires pthread but it was not found on your system")
|
|
|
|
|
|
|
|
endif(PTHREAD_LIBRARIES)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# pcre (using find_library and find_path)
|
|
|
|
# pcre (using find_library and find_path)
|
|
|
|
find_library(PCRE_LIBRARIES pcre)
|
|
|
|
find_library(PCRE_LIBRARIES pcre)
|
|
|
@ -446,13 +436,13 @@ if(PCRE_LIBRARIES)
|
|
|
|
if(PCRE_INCLUDE_DIR)
|
|
|
|
if(PCRE_INCLUDE_DIR)
|
|
|
|
include_directories("${PCRE_INCLUDE_DIR}")
|
|
|
|
include_directories("${PCRE_INCLUDE_DIR}")
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES "${PCRE_INCLUDE_DIR}")
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES "${PCRE_INCLUDE_DIR}")
|
|
|
|
endif(PCRE_INCLUDE_DIR)
|
|
|
|
endif()
|
|
|
|
mark_as_advanced(FORCE PCRE_LIBRARIES PCRE_INCLUDE_DIR)
|
|
|
|
mark_as_advanced(FORCE PCRE_LIBRARIES PCRE_INCLUDE_DIR)
|
|
|
|
check_include_file("pcre.h" HAVE_PCRE_H)
|
|
|
|
check_include_file("pcre.h" HAVE_PCRE_H)
|
|
|
|
set(optlibsfound "${optlibsfound} PCRE")
|
|
|
|
set(optlibsfound "${optlibsfound} PCRE")
|
|
|
|
else(PCRE_LIBRARIES)
|
|
|
|
else()
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} PCRE")
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} PCRE")
|
|
|
|
endif(PCRE_LIBRARIES)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# gcrypt (using find_library and find_path)
|
|
|
|
# gcrypt (using find_library and find_path)
|
|
|
|
find_library(GCRYPT_LIBRARIES gcrypt)
|
|
|
|
find_library(GCRYPT_LIBRARIES gcrypt)
|
|
|
@ -463,13 +453,13 @@ if(GCRYPT_LIBRARIES)
|
|
|
|
if(GCRYPT_INCLUDE_DIR)
|
|
|
|
if(GCRYPT_INCLUDE_DIR)
|
|
|
|
include_directories("${GCRYPT_INCLUDE_DIR}")
|
|
|
|
include_directories("${GCRYPT_INCLUDE_DIR}")
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES "${GCRYPT_INCLUDE_DIR}")
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES "${GCRYPT_INCLUDE_DIR}")
|
|
|
|
endif(GCRYPT_INCLUDE_DIR)
|
|
|
|
endif()
|
|
|
|
mark_as_advanced(FORCE GCRYPT_LIBRARIES GCRYPT_INCLUDE_DIR)
|
|
|
|
mark_as_advanced(FORCE GCRYPT_LIBRARIES GCRYPT_INCLUDE_DIR)
|
|
|
|
check_include_file("gcrypt.h" HAVE_GCRYPT_H)
|
|
|
|
check_include_file("gcrypt.h" HAVE_GCRYPT_H)
|
|
|
|
set(optlibsfound "${optlibsfound} GCrypt")
|
|
|
|
set(optlibsfound "${optlibsfound} GCrypt")
|
|
|
|
else(GCRYPT_LIBRARIES)
|
|
|
|
else()
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} GCrypt")
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} GCrypt")
|
|
|
|
endif(GCRYPT_LIBRARIES)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# mysqlclient (using find_library and find_path)
|
|
|
|
# mysqlclient (using find_library and find_path)
|
|
|
|
find_library(MYSQLCLIENT_LIBRARIES mysqlclient PATH_SUFFIXES mysql)
|
|
|
|
find_library(MYSQLCLIENT_LIBRARIES mysqlclient PATH_SUFFIXES mysql)
|
|
|
@ -480,17 +470,15 @@ if(MYSQLCLIENT_LIBRARIES)
|
|
|
|
if(MYSQLCLIENT_INCLUDE_DIR)
|
|
|
|
if(MYSQLCLIENT_INCLUDE_DIR)
|
|
|
|
include_directories("${MYSQLCLIENT_INCLUDE_DIR}")
|
|
|
|
include_directories("${MYSQLCLIENT_INCLUDE_DIR}")
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES "${MYSQLCLIENT_INCLUDE_DIR}")
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES "${MYSQLCLIENT_INCLUDE_DIR}")
|
|
|
|
endif(MYSQLCLIENT_INCLUDE_DIR)
|
|
|
|
endif()
|
|
|
|
mark_as_advanced(FORCE MYSQLCLIENT_LIBRARIES MYSQLCLIENT_INCLUDE_DIR)
|
|
|
|
mark_as_advanced(FORCE MYSQLCLIENT_LIBRARIES MYSQLCLIENT_INCLUDE_DIR)
|
|
|
|
check_include_file("mysql.h" HAVE_MYSQL_H)
|
|
|
|
check_include_file("mysql.h" HAVE_MYSQL_H)
|
|
|
|
if(NOT HAVE_MYSQL_H)
|
|
|
|
if(NOT HAVE_MYSQL_H)
|
|
|
|
message(FATAL_ERROR
|
|
|
|
message(FATAL_ERROR "ZoneMinder requires MySQL headers - check that MySQL development packages are installed")
|
|
|
|
"ZoneMinder requires MySQL headers - check that MySQL development packages are installed")
|
|
|
|
endif()
|
|
|
|
endif(NOT HAVE_MYSQL_H)
|
|
|
|
else()
|
|
|
|
else(MYSQLCLIENT_LIBRARIES)
|
|
|
|
message(FATAL_ERROR "ZoneMinder requires mysqlclient but it was not found on your system")
|
|
|
|
message(FATAL_ERROR
|
|
|
|
endif()
|
|
|
|
"ZoneMinder requires mysqlclient but it was not found on your system")
|
|
|
|
|
|
|
|
endif(MYSQLCLIENT_LIBRARIES)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set(PATH_FFMPEG "")
|
|
|
|
set(PATH_FFMPEG "")
|
|
|
|
set(OPT_FFMPEG "no")
|
|
|
|
set(OPT_FFMPEG "no")
|
|
|
@ -503,13 +491,13 @@ if(AVFORMAT_LIBRARIES)
|
|
|
|
if(AVFORMAT_INCLUDE_DIR)
|
|
|
|
if(AVFORMAT_INCLUDE_DIR)
|
|
|
|
include_directories("${AVFORMAT_INCLUDE_DIR}")
|
|
|
|
include_directories("${AVFORMAT_INCLUDE_DIR}")
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES "${AVFORMAT_INCLUDE_DIR}")
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES "${AVFORMAT_INCLUDE_DIR}")
|
|
|
|
endif(AVFORMAT_INCLUDE_DIR)
|
|
|
|
endif()
|
|
|
|
mark_as_advanced(FORCE AVFORMAT_LIBRARIES AVFORMAT_INCLUDE_DIR)
|
|
|
|
mark_as_advanced(FORCE AVFORMAT_LIBRARIES AVFORMAT_INCLUDE_DIR)
|
|
|
|
check_include_file("libavformat/avformat.h" HAVE_LIBAVFORMAT_AVFORMAT_H)
|
|
|
|
check_include_file("libavformat/avformat.h" HAVE_LIBAVFORMAT_AVFORMAT_H)
|
|
|
|
set(optlibsfound "${optlibsfound} AVFormat")
|
|
|
|
set(optlibsfound "${optlibsfound} AVFormat")
|
|
|
|
else(AVFORMAT_LIBRARIES)
|
|
|
|
else()
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} AVFormat")
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} AVFormat")
|
|
|
|
endif(AVFORMAT_LIBRARIES)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# avcodec (using find_library and find_path)
|
|
|
|
# avcodec (using find_library and find_path)
|
|
|
|
find_library(AVCODEC_LIBRARIES avcodec)
|
|
|
|
find_library(AVCODEC_LIBRARIES avcodec)
|
|
|
@ -520,14 +508,14 @@ if(AVCODEC_LIBRARIES)
|
|
|
|
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()
|
|
|
|
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()
|
|
|
|
message(WARNING "\nWhile it should be possible to build ZM without AVCODEC the result will pretty useless.")
|
|
|
|
message(WARNING "\nWhile it should be possible to build ZM without AVCODEC the result will pretty useless.")
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} AVCodec")
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} AVCodec")
|
|
|
|
endif(AVCODEC_LIBRARIES)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# avdevice (using find_library and find_path)
|
|
|
|
# avdevice (using find_library and find_path)
|
|
|
|
find_library(AVDEVICE_LIBRARIES avdevice)
|
|
|
|
find_library(AVDEVICE_LIBRARIES avdevice)
|
|
|
@ -538,13 +526,13 @@ if(AVDEVICE_LIBRARIES)
|
|
|
|
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()
|
|
|
|
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()
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} AVDevice")
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} AVDevice")
|
|
|
|
endif(AVDEVICE_LIBRARIES)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# avutil (using find_library and find_path)
|
|
|
|
# avutil (using find_library and find_path)
|
|
|
|
find_library(AVUTIL_LIBRARIES avutil)
|
|
|
|
find_library(AVUTIL_LIBRARIES avutil)
|
|
|
@ -555,15 +543,15 @@ if(AVUTIL_LIBRARIES)
|
|
|
|
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()
|
|
|
|
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()
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} AVUtil")
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} AVUtil")
|
|
|
|
endif(AVUTIL_LIBRARIES)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# swscale (using find_library and find_path)
|
|
|
|
# swscale (using find_library and find_path)
|
|
|
|
find_library(SWSCALE_LIBRARIES swscale)
|
|
|
|
find_library(SWSCALE_LIBRARIES swscale)
|
|
|
@ -574,13 +562,13 @@ if(SWSCALE_LIBRARIES)
|
|
|
|
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()
|
|
|
|
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()
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} SWScale")
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} SWScale")
|
|
|
|
endif(SWSCALE_LIBRARIES)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# SWresample (using find_library and find_path)
|
|
|
|
# SWresample (using find_library and find_path)
|
|
|
|
find_library(SWRESAMPLE_LIBRARIES swresample)
|
|
|
|
find_library(SWRESAMPLE_LIBRARIES swresample)
|
|
|
@ -591,11 +579,11 @@ if(SWRESAMPLE_LIBRARIES)
|
|
|
|
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()
|
|
|
|
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()
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} SWResample")
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} SWResample")
|
|
|
|
|
|
|
|
|
|
|
|
# AVresample (using find_library and find_path)
|
|
|
|
# AVresample (using find_library and find_path)
|
|
|
@ -607,15 +595,14 @@ else(SWRESAMPLE_LIBRARIES)
|
|
|
|
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()
|
|
|
|
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()
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} AVResample")
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} AVResample")
|
|
|
|
endif(AVRESAMPLE_LIBRARIES)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
endif()
|
|
|
|
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
|
|
|
@ -625,7 +612,7 @@ 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()
|
|
|
|
|
|
|
|
|
|
|
|
# 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)
|
|
|
@ -638,14 +625,14 @@ if(NOT ZM_NO_LIBVLC)
|
|
|
|
if(LIBVLC_INCLUDE_DIR)
|
|
|
|
if(LIBVLC_INCLUDE_DIR)
|
|
|
|
include_directories("${LIBVLC_INCLUDE_DIR}")
|
|
|
|
include_directories("${LIBVLC_INCLUDE_DIR}")
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES "${LIBVLC_INCLUDE_DIR}")
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES "${LIBVLC_INCLUDE_DIR}")
|
|
|
|
endif(LIBVLC_INCLUDE_DIR)
|
|
|
|
endif()
|
|
|
|
mark_as_advanced(FORCE LIBVLC_LIBRARIES LIBVLC_INCLUDE_DIR)
|
|
|
|
mark_as_advanced(FORCE LIBVLC_LIBRARIES LIBVLC_INCLUDE_DIR)
|
|
|
|
check_include_file("vlc/vlc.h" HAVE_VLC_VLC_H)
|
|
|
|
check_include_file("vlc/vlc.h" HAVE_VLC_VLC_H)
|
|
|
|
set(optlibsfound "${optlibsfound} libVLC")
|
|
|
|
set(optlibsfound "${optlibsfound} libVLC")
|
|
|
|
else(LIBVLC_LIBRARIES)
|
|
|
|
else()
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} libVLC")
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} libVLC")
|
|
|
|
endif(LIBVLC_LIBRARIES)
|
|
|
|
endif()
|
|
|
|
endif(NOT ZM_NO_LIBVLC)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
if(NOT ZM_NO_LIBVNC)
|
|
|
|
if(NOT ZM_NO_LIBVNC)
|
|
|
|
# libvncclient (using find_library and find_path)
|
|
|
|
# libvncclient (using find_library and find_path)
|
|
|
@ -657,14 +644,14 @@ if(NOT ZM_NO_LIBVNC)
|
|
|
|
if(LIBVNC_INCLUDE_DIR)
|
|
|
|
if(LIBVNC_INCLUDE_DIR)
|
|
|
|
include_directories("${LIBVNC_INCLUDE_DIR}")
|
|
|
|
include_directories("${LIBVNC_INCLUDE_DIR}")
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES "${LIBVNC_INCLUDE_DIR}")
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES "${LIBVNC_INCLUDE_DIR}")
|
|
|
|
endif(LIBVNC_INCLUDE_DIR)
|
|
|
|
endif()
|
|
|
|
mark_as_advanced(FORCE LIBVNC_LIBRARIES LIBVNC_INCLUDE_DIR)
|
|
|
|
mark_as_advanced(FORCE LIBVNC_LIBRARIES LIBVNC_INCLUDE_DIR)
|
|
|
|
check_include_file("rfb/rfb.h" HAVE_RFB_RFB_H)
|
|
|
|
check_include_file("rfb/rfb.h" HAVE_RFB_RFB_H)
|
|
|
|
set(optlibsfound "${optlibsfound} libVNC")
|
|
|
|
set(optlibsfound "${optlibsfound} libVNC")
|
|
|
|
else(LIBVNC_LIBRARIES)
|
|
|
|
else()
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} libVNC")
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} libVNC")
|
|
|
|
endif(LIBVNC_LIBRARIES)
|
|
|
|
endif()
|
|
|
|
endif(NOT ZM_NO_LIBVNC)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
#find_package(Boost 1.36.0)
|
|
|
|
#find_package(Boost 1.36.0)
|
|
|
|
#if(Boost_FOUND)
|
|
|
|
#if(Boost_FOUND)
|
|
|
@ -681,22 +668,21 @@ if(NOT ZM_NO_RTSPSERVER)
|
|
|
|
list(APPEND ZM_BIN_LIBS "${Live555_LIBRARIES}")
|
|
|
|
list(APPEND ZM_BIN_LIBS "${Live555_LIBRARIES}")
|
|
|
|
set(HAVE_RTSP_SERVER 1)
|
|
|
|
set(HAVE_RTSP_SERVER 1)
|
|
|
|
set(optlibsfound "${optlibsfound} libLive555")
|
|
|
|
set(optlibsfound "${optlibsfound} libLive555")
|
|
|
|
else(Live555_FOUND)
|
|
|
|
else()
|
|
|
|
set(HAVE_RTSP_SERVER 0)
|
|
|
|
set(HAVE_RTSP_SERVER 0)
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} libLive555")
|
|
|
|
set(optlibsnotfound "${optlibsnotfound} libLive555")
|
|
|
|
endif(Live555_FOUND)
|
|
|
|
endif()
|
|
|
|
else(NOT ZM_NO_RTSPSERVER)
|
|
|
|
else()
|
|
|
|
set(HAVE_RTSP_SERVER 0)
|
|
|
|
set(HAVE_RTSP_SERVER 0)
|
|
|
|
endif(NOT ZM_NO_RTSPSERVER)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# *** END OF LIBRARY CHECKS ***
|
|
|
|
# *** END OF LIBRARY CHECKS ***
|
|
|
|
|
|
|
|
|
|
|
|
# Check for gnutls or crypto
|
|
|
|
# Check for gnutls or crypto
|
|
|
|
if((NOT HAVE_LIBCRYPTO) AND (NOT HAVE_LIBGNUTLS))
|
|
|
|
if((NOT HAVE_LIBCRYPTO) AND (NOT HAVE_LIBGNUTLS))
|
|
|
|
message(FATAL_ERROR
|
|
|
|
message(FATAL_ERROR "ZoneMinder requires crypto or gnutls but none were found on your system")
|
|
|
|
"ZoneMinder requires crypto or gnutls but none were found on your system")
|
|
|
|
endif()
|
|
|
|
endif((NOT HAVE_LIBCRYPTO) AND (NOT HAVE_LIBGNUTLS))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Check for V4L header files and enable ZM_HAS_V4L, ZM_HAS_V4L1, ZM_HAS_V4L2 accordingly
|
|
|
|
# Check for V4L header files and enable ZM_HAS_V4L, ZM_HAS_V4L1, ZM_HAS_V4L2 accordingly
|
|
|
|
# Setting to zeros first is required because ZM uses #define for these
|
|
|
|
# Setting to zeros first is required because ZM uses #define for these
|
|
|
@ -706,24 +692,21 @@ set(ZM_HAS_V4L2 0)
|
|
|
|
if(HAVE_LINUX_VIDEODEV_H OR HAVE_LIBV4L1_VIDEODEV_H)
|
|
|
|
if(HAVE_LINUX_VIDEODEV_H OR HAVE_LIBV4L1_VIDEODEV_H)
|
|
|
|
set(ZM_HAS_V4L 1)
|
|
|
|
set(ZM_HAS_V4L 1)
|
|
|
|
set(ZM_HAS_V4L1 1)
|
|
|
|
set(ZM_HAS_V4L1 1)
|
|
|
|
endif(HAVE_LINUX_VIDEODEV_H OR HAVE_LIBV4L1_VIDEODEV_H)
|
|
|
|
endif()
|
|
|
|
if(HAVE_LINUX_VIDEODEV2_H)
|
|
|
|
if(HAVE_LINUX_VIDEODEV2_H)
|
|
|
|
set(ZM_HAS_V4L 1)
|
|
|
|
set(ZM_HAS_V4L 1)
|
|
|
|
set(ZM_HAS_V4L2 1)
|
|
|
|
set(ZM_HAS_V4L2 1)
|
|
|
|
endif(HAVE_LINUX_VIDEODEV2_H)
|
|
|
|
endif()
|
|
|
|
if((NOT HAVE_LINUX_VIDEODEV_H)
|
|
|
|
if((NOT HAVE_LINUX_VIDEODEV_H)
|
|
|
|
AND (NOT HAVE_LIBV4L1_VIDEODEV_H)
|
|
|
|
AND (NOT HAVE_LIBV4L1_VIDEODEV_H)
|
|
|
|
AND (NOT HAVE_LINUX_VIDEODEV2_H))
|
|
|
|
AND (NOT HAVE_LINUX_VIDEODEV2_H))
|
|
|
|
message(AUTHOR_WARNING
|
|
|
|
message(AUTHOR_WARNING "Video 4 Linux headers weren't found - Analog and USB camera support will not be available")
|
|
|
|
"Video 4 Linux headers weren't found - Analog and USB camera support will not be available")
|
|
|
|
endif()
|
|
|
|
endif((NOT HAVE_LINUX_VIDEODEV_H)
|
|
|
|
|
|
|
|
AND (NOT HAVE_LIBV4L1_VIDEODEV_H)
|
|
|
|
|
|
|
|
AND (NOT HAVE_LINUX_VIDEODEV2_H))
|
|
|
|
|
|
|
|
# Check for PCRE and enable ZM_PCRE accordingly
|
|
|
|
# Check for PCRE and enable ZM_PCRE accordingly
|
|
|
|
set(ZM_PCRE 0)
|
|
|
|
set(ZM_PCRE 0)
|
|
|
|
if(HAVE_LIBPCRE AND HAVE_PCRE_H)
|
|
|
|
if(HAVE_LIBPCRE AND HAVE_PCRE_H)
|
|
|
|
set(ZM_PCRE 1)
|
|
|
|
set(ZM_PCRE 1)
|
|
|
|
endif(HAVE_LIBPCRE AND HAVE_PCRE_H)
|
|
|
|
endif()
|
|
|
|
# Check for mmap and enable in all components
|
|
|
|
# Check for mmap and enable in all components
|
|
|
|
set(ZM_MEM_MAPPED 0)
|
|
|
|
set(ZM_MEM_MAPPED 0)
|
|
|
|
set(ENABLE_MMAP no)
|
|
|
|
set(ENABLE_MMAP no)
|
|
|
@ -731,13 +714,13 @@ if(NOT ZM_NO_MMAP)
|
|
|
|
set(ZM_MEM_MAPPED 1)
|
|
|
|
set(ZM_MEM_MAPPED 1)
|
|
|
|
set(ENABLE_MMAP yes)
|
|
|
|
set(ENABLE_MMAP yes)
|
|
|
|
set(ZM_MMAP_PERLPACKAGE "Sys::Mmap")
|
|
|
|
set(ZM_MMAP_PERLPACKAGE "Sys::Mmap")
|
|
|
|
endif(NOT ZM_NO_MMAP)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# Check for the ONVIF flag and enable ZM_HAS_ONVIF accordingly
|
|
|
|
# Check for the ONVIF flag and enable ZM_HAS_ONVIF accordingly
|
|
|
|
set(ZM_HAS_ONVIF 0)
|
|
|
|
set(ZM_HAS_ONVIF 0)
|
|
|
|
if(ZM_ONVIF)
|
|
|
|
if(ZM_ONVIF)
|
|
|
|
set(ZM_HAS_ONVIF 1)
|
|
|
|
set(ZM_HAS_ONVIF 1)
|
|
|
|
endif(ZM_ONVIF)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# Check for authentication functions
|
|
|
|
# Check for authentication functions
|
|
|
|
if(HAVE_OPENSSL_MD5_H)
|
|
|
|
if(HAVE_OPENSSL_MD5_H)
|
|
|
@ -747,7 +730,7 @@ if(HAVE_OPENSSL_MD5_H)
|
|
|
|
MD5
|
|
|
|
MD5
|
|
|
|
"unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md)" "NULL" "openssl/md5.h"
|
|
|
|
"unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md)" "NULL" "openssl/md5.h"
|
|
|
|
HAVE_MD5_OPENSSL)
|
|
|
|
HAVE_MD5_OPENSSL)
|
|
|
|
endif(HAVE_OPENSSL_MD5_H)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
if(HAVE_GNUTLS_GNUTLS_H)
|
|
|
|
if(HAVE_GNUTLS_GNUTLS_H)
|
|
|
|
set(CMAKE_REQUIRED_LIBRARIES "${GNUTLS_LIBRARIES}")
|
|
|
|
set(CMAKE_REQUIRED_LIBRARIES "${GNUTLS_LIBRARIES}")
|
|
|
@ -756,31 +739,30 @@ if(HAVE_GNUTLS_GNUTLS_H)
|
|
|
|
gnutls_fingerprint
|
|
|
|
gnutls_fingerprint
|
|
|
|
"int gnutls_fingerprint (gnutls_digest_algorithm_t algo, const gnutls_datum_t * data, void *result, size_t * result_size)" "0" "stdlib.h;gnutls/gnutls.h"
|
|
|
|
"int gnutls_fingerprint (gnutls_digest_algorithm_t algo, const gnutls_datum_t * data, void *result, size_t * result_size)" "0" "stdlib.h;gnutls/gnutls.h"
|
|
|
|
HAVE_DECL_GNUTLS_FINGERPRINT)
|
|
|
|
HAVE_DECL_GNUTLS_FINGERPRINT)
|
|
|
|
endif(HAVE_GNUTLS_GNUTLS_H)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
if(NOT HAVE_DECL_GNUTLS_FINGERPRINT AND HAVE_MD5_OPENSSL)
|
|
|
|
if(NOT HAVE_DECL_GNUTLS_FINGERPRINT AND HAVE_MD5_OPENSSL)
|
|
|
|
set(HAVE_DECL_MD5 1)
|
|
|
|
set(HAVE_DECL_MD5 1)
|
|
|
|
endif(NOT HAVE_DECL_GNUTLS_FINGERPRINT AND HAVE_MD5_OPENSSL)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
if((NOT HAVE_MD5_OPENSSL) AND (NOT HAVE_DECL_GNUTLS_FINGERPRINT))
|
|
|
|
if((NOT HAVE_MD5_OPENSSL) AND (NOT HAVE_DECL_GNUTLS_FINGERPRINT))
|
|
|
|
message(AUTHOR_WARNING
|
|
|
|
message(AUTHOR_WARNING
|
|
|
|
"ZoneMinder requires a working MD5 function for hashed authentication but
|
|
|
|
"ZoneMinder requires a working MD5 function for hashed authentication but
|
|
|
|
none were found - hashed authentication will not be available")
|
|
|
|
none were found - hashed authentication will not be available")
|
|
|
|
endif((NOT HAVE_MD5_OPENSSL) AND (NOT HAVE_DECL_GNUTLS_FINGERPRINT))
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# Dirty fix for zm_user only using openssl's md5 if gnutls and gcrypt are not available.
|
|
|
|
# Dirty fix for zm_user only using openssl's md5 if gnutls and gcrypt are not available.
|
|
|
|
# This needs to be fixed in zm_user.[h,cpp] but such fix will also require changes to configure.ac
|
|
|
|
# This needs to be fixed in zm_user.[h,cpp] but such fix will also require changes to configure.ac
|
|
|
|
if(HAVE_LIBCRYPTO AND HAVE_OPENSSL_MD5_H AND HAVE_MD5_OPENSSL)
|
|
|
|
if(HAVE_LIBCRYPTO AND HAVE_OPENSSL_MD5_H AND HAVE_MD5_OPENSSL)
|
|
|
|
set(HAVE_GCRYPT_H 0)
|
|
|
|
set(HAVE_GCRYPT_H 0)
|
|
|
|
set(HAVE_GNUTLS_OPENSSL_H 0)
|
|
|
|
set(HAVE_GNUTLS_OPENSSL_H 0)
|
|
|
|
endif(HAVE_LIBCRYPTO AND HAVE_OPENSSL_MD5_H AND HAVE_MD5_OPENSSL)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# Check for Perl
|
|
|
|
# Check for Perl
|
|
|
|
find_package(Perl)
|
|
|
|
find_package(Perl)
|
|
|
|
if(NOT PERL_FOUND)
|
|
|
|
if(NOT PERL_FOUND)
|
|
|
|
message(FATAL_ERROR
|
|
|
|
message(FATAL_ERROR "ZoneMinder requires Perl 5.6.0 or newer but it was not found on your system")
|
|
|
|
"ZoneMinder requires Perl 5.6.0 or newer but it was not found on your system")
|
|
|
|
endif()
|
|
|
|
endif(NOT PERL_FOUND)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Checking for perl modules requires FindPerlModules.cmake
|
|
|
|
# Checking for perl modules requires FindPerlModules.cmake
|
|
|
|
# Check all required modules at once
|
|
|
|
# Check all required modules at once
|
|
|
@ -790,9 +772,8 @@ find_package(
|
|
|
|
Getopt::Long Time::HiRes Date::Manip LWP::UserAgent
|
|
|
|
Getopt::Long Time::HiRes Date::Manip LWP::UserAgent
|
|
|
|
ExtUtils::MakeMaker ${ZM_MMAP_PERLPACKAGE})
|
|
|
|
ExtUtils::MakeMaker ${ZM_MMAP_PERLPACKAGE})
|
|
|
|
if(NOT PERLMODULES_FOUND)
|
|
|
|
if(NOT PERLMODULES_FOUND)
|
|
|
|
message(WARNING
|
|
|
|
message(WARNING "Not all required perl modules were found on your system")
|
|
|
|
"Not all required perl modules were found on your system")
|
|
|
|
endif()
|
|
|
|
endif(NOT PERLMODULES_FOUND)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Attempt to check which user apache (or other web server) runs on by
|
|
|
|
# Attempt to check which user apache (or other web server) runs on by
|
|
|
|
# searching for a user beginning with apache or www and then cutting the user
|
|
|
|
# searching for a user beginning with apache or www and then cutting the user
|
|
|
@ -812,13 +793,13 @@ if(ZM_WEB_USER STREQUAL "")
|
|
|
|
COMMAND echo ${userline_www}
|
|
|
|
COMMAND echo ${userline_www}
|
|
|
|
COMMAND cut -d: -f1 OUTPUT_VARIABLE ZM_WEB_USER
|
|
|
|
COMMAND cut -d: -f1 OUTPUT_VARIABLE ZM_WEB_USER
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
endif(NOT (userline_apache STREQUAL ""))
|
|
|
|
endif()
|
|
|
|
message(STATUS "Detected web server user: ${ZM_WEB_USER}")
|
|
|
|
message(STATUS "Detected web server user: ${ZM_WEB_USER}")
|
|
|
|
endif(ZM_WEB_USER STREQUAL "")
|
|
|
|
endif()
|
|
|
|
# Check if webgroup contains anything. If not, use the web user as the web group
|
|
|
|
# Check if webgroup contains anything. If not, use the web user as the web group
|
|
|
|
if(NOT ZM_WEB_GROUP)
|
|
|
|
if(NOT ZM_WEB_GROUP)
|
|
|
|
set(ZM_WEB_GROUP ${ZM_WEB_USER})
|
|
|
|
set(ZM_WEB_GROUP ${ZM_WEB_USER})
|
|
|
|
endif(NOT ZM_WEB_GROUP)
|
|
|
|
endif()
|
|
|
|
message(STATUS "Using web user: ${ZM_WEB_USER}")
|
|
|
|
message(STATUS "Using web user: ${ZM_WEB_USER}")
|
|
|
|
message(STATUS "Using web group: ${ZM_WEB_GROUP}")
|
|
|
|
message(STATUS "Using web group: ${ZM_WEB_GROUP}")
|
|
|
|
|
|
|
|
|
|
|
@ -826,10 +807,9 @@ if(WITH_SYSTEMD)
|
|
|
|
# Check for polkit
|
|
|
|
# Check for polkit
|
|
|
|
find_package(Polkit)
|
|
|
|
find_package(Polkit)
|
|
|
|
if(NOT POLKIT_FOUND)
|
|
|
|
if(NOT POLKIT_FOUND)
|
|
|
|
message(WARNING
|
|
|
|
message(WARNING "Running ZoneMinder requires polkit. Building ZoneMinder requires the polkit development package.")
|
|
|
|
"Running ZoneMinder requires polkit. Building ZoneMinder requires the polkit development package.")
|
|
|
|
endif()
|
|
|
|
endif(NOT POLKIT_FOUND)
|
|
|
|
endif()
|
|
|
|
endif(WITH_SYSTEMD)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Find the path to an arp compatible executable
|
|
|
|
# Find the path to an arp compatible executable
|
|
|
|
if(ZM_PATH_ARP STREQUAL "")
|
|
|
|
if(ZM_PATH_ARP STREQUAL "")
|
|
|
@ -837,17 +817,17 @@ if(ZM_PATH_ARP STREQUAL "")
|
|
|
|
if(ARP_EXECUTABLE)
|
|
|
|
if(ARP_EXECUTABLE)
|
|
|
|
set(ZM_PATH_ARP "${ARP_EXECUTABLE}")
|
|
|
|
set(ZM_PATH_ARP "${ARP_EXECUTABLE}")
|
|
|
|
mark_as_advanced(ARP_EXECUTABLE)
|
|
|
|
mark_as_advanced(ARP_EXECUTABLE)
|
|
|
|
else(ARP_EXECUTABLE)
|
|
|
|
else()
|
|
|
|
find_program(ARP_EXECUTABLE ip)
|
|
|
|
find_program(ARP_EXECUTABLE ip)
|
|
|
|
if(ARP_EXECUTABLE)
|
|
|
|
if(ARP_EXECUTABLE)
|
|
|
|
set(ZM_PATH_ARP "${ARP_EXECUTABLE} neigh")
|
|
|
|
set(ZM_PATH_ARP "${ARP_EXECUTABLE} neigh")
|
|
|
|
mark_as_advanced(ARP_EXECUTABLE)
|
|
|
|
mark_as_advanced(ARP_EXECUTABLE)
|
|
|
|
endif(ARP_EXECUTABLE)
|
|
|
|
endif()
|
|
|
|
endif(ARP_EXECUTABLE)
|
|
|
|
endif()
|
|
|
|
if(ARP_EXECUTABLE-NOTFOUND)
|
|
|
|
if(ARP_EXECUTABLE-NOTFOUND)
|
|
|
|
message(WARNING "Unable to find a compatible arp binary. Monitor probe will not function.")
|
|
|
|
message(WARNING "Unable to find a compatible arp binary. Monitor probe will not function.")
|
|
|
|
endif(ARP_EXECUTABLE-NOTFOUND)
|
|
|
|
endif()
|
|
|
|
endif(ZM_PATH_ARP STREQUAL "")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# Some variables that zm expects
|
|
|
|
# Some variables that zm expects
|
|
|
|
set(ZM_PID "${ZM_RUNDIR}/zm.pid")
|
|
|
|
set(ZM_PID "${ZM_RUNDIR}/zm.pid")
|
|
|
@ -865,14 +845,14 @@ set(WEB_GROUP "${ZM_WEB_GROUP}")
|
|
|
|
set(ZM_DB_TYPE "mysql")
|
|
|
|
set(ZM_DB_TYPE "mysql")
|
|
|
|
if(ZM_PERL_SEARCH_PATH)
|
|
|
|
if(ZM_PERL_SEARCH_PATH)
|
|
|
|
set(EXTRA_PERL_LIB "use lib '${ZM_PERL_SEARCH_PATH}'; # Include custom perl install path")
|
|
|
|
set(EXTRA_PERL_LIB "use lib '${ZM_PERL_SEARCH_PATH}'; # Include custom perl install path")
|
|
|
|
else(ZM_PERL_SEARCH_PATH)
|
|
|
|
else()
|
|
|
|
set(EXTRA_PERL_LIB "# Include from system perl paths only")
|
|
|
|
set(EXTRA_PERL_LIB "# Include from system perl paths only")
|
|
|
|
endif(ZM_PERL_SEARCH_PATH)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# If this is an out-of-source build, copy the files we need to the binary directory
|
|
|
|
# If this is an out-of-source build, copy the files we need to the binary directory
|
|
|
|
if(NOT (CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR))
|
|
|
|
if(NOT (CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR))
|
|
|
|
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/conf.d" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" PATTERN "*.in" EXCLUDE)
|
|
|
|
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/conf.d" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" PATTERN "*.in" EXCLUDE)
|
|
|
|
endif(NOT (CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR))
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# Generate files from the .in files
|
|
|
|
# Generate files from the .in files
|
|
|
|
configure_file(zm.conf.in "${CMAKE_CURRENT_BINARY_DIR}/zm.conf" @ONLY)
|
|
|
|
configure_file(zm.conf.in "${CMAKE_CURRENT_BINARY_DIR}/zm.conf" @ONLY)
|
|
|
@ -908,14 +888,14 @@ if(BUILD_TEST_SUITE)
|
|
|
|
add_subdirectory(tests)
|
|
|
|
add_subdirectory(tests)
|
|
|
|
else()
|
|
|
|
else()
|
|
|
|
message("Building unit tests: No (default)")
|
|
|
|
message("Building unit tests: No (default)")
|
|
|
|
endif(BUILD_TEST_SUITE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# Process distro subdirectories
|
|
|
|
# Process distro subdirectories
|
|
|
|
if((ZM_TARGET_DISTRO MATCHES "^el") OR (ZM_TARGET_DISTRO MATCHES "^fc"))
|
|
|
|
if((ZM_TARGET_DISTRO MATCHES "^el") OR (ZM_TARGET_DISTRO MATCHES "^fc"))
|
|
|
|
add_subdirectory(distros/redhat)
|
|
|
|
add_subdirectory(distros/redhat)
|
|
|
|
elseif(ZM_TARGET_DISTRO STREQUAL "OS13")
|
|
|
|
elseif()
|
|
|
|
add_subdirectory(distros/opensuse)
|
|
|
|
add_subdirectory(distros/opensuse)
|
|
|
|
endif((ZM_TARGET_DISTRO MATCHES "^el") OR (ZM_TARGET_DISTRO MATCHES "^fc"))
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
# Print optional libraries detection status
|
|
|
|
# Print optional libraries detection status
|
|
|
|
message(STATUS "Optional libraries found:${optlibsfound}")
|
|
|
|
message(STATUS "Optional libraries found:${optlibsfound}")
|
|
|
@ -923,14 +903,12 @@ message(STATUS "Optional libraries not found:${optlibsnotfound}")
|
|
|
|
|
|
|
|
|
|
|
|
# Run ZM configuration generator
|
|
|
|
# Run ZM configuration generator
|
|
|
|
message(STATUS "Running ZoneMinder configuration generator")
|
|
|
|
message(STATUS "Running ZoneMinder configuration generator")
|
|
|
|
execute_process(COMMAND perl ${CMAKE_CURRENT_BINARY_DIR}/zmconfgen.pl RESULT_VARIABLE zmconfgen_result)
|
|
|
|
execute_process(COMMAND perl ${CMAKE_CURRENT_BINARY_DIR}/zmconfgen.pl RESULT_VARIABLE ZMCONFGEN_RESULT)
|
|
|
|
if(zmconfgen_result EQUAL 0)
|
|
|
|
if(ZMCONFGEN_RESULT EQUAL 0)
|
|
|
|
message(STATUS
|
|
|
|
message(STATUS "ZoneMinder configuration generator completed successfully")
|
|
|
|
"ZoneMinder configuration generator completed successfully")
|
|
|
|
else()
|
|
|
|
else(zmconfgen_result EQUAL 0)
|
|
|
|
message(FATAL_ERROR "ZoneMinder configuration generator failed. Exit code: ${zmconfgen_result}")
|
|
|
|
message(FATAL_ERROR
|
|
|
|
endif()
|
|
|
|
"ZoneMinder configuration generator failed. Exit code: ${zmconfgen_result}")
|
|
|
|
|
|
|
|
endif(zmconfgen_result EQUAL 0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Install zm.conf
|
|
|
|
# Install zm.conf
|
|
|
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/zm.conf" DESTINATION "${ZM_CONFIG_DIR}")
|
|
|
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/zm.conf" DESTINATION "${ZM_CONFIG_DIR}")
|
|
|
@ -949,6 +927,6 @@ find_program(CCACHE_FOUND ccache)
|
|
|
|
if(CCACHE_FOUND)
|
|
|
|
if(CCACHE_FOUND)
|
|
|
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
|
|
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
|
|
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
|
|
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
|
|
|
endif(CCACHE_FOUND)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
install(DIRECTORY icons DESTINATION "${CMAKE_INSTALL_DATADIR}/zoneminder/")
|
|
|
|
install(DIRECTORY icons DESTINATION "${CMAKE_INSTALL_DATADIR}/zoneminder/")
|
|
|
|