diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a9b409f3..92a89b5fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -161,8 +161,29 @@ include_directories("${CMAKE_BINARY_DIR}") # This is required to enable searching in lib64 (if exists), do not change set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ON) +# Host OS Check +set(HOST_OS "") +if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + set(HOST_OS "linux") +endif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") +if(${CMAKE_SYSTEM_NAME} MATCHES ".*(SunOS|Solaris).*") + set(HOST_OS "solaris") + set(SOLARIS 1) +endif(${CMAKE_SYSTEM_NAME} MATCHES ".*(SunOS|Solaris).*") +if(${CMAKE_SYSTEM_NAME} MATCHES ".*BSD.*") + set(HOST_OS "BSD") + set(BSD 1) +endif(${CMAKE_SYSTEM_NAME} MATCHES ".*BSD.*") +if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + set(HOST_OS "darwin") +endif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") +if(NOT HOST_OS) + message(FATAL_ERROR + "ZoneMinder was unable to deterimine the host OS. Please report this. Value of CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}") +endif(NOT HOST_OS) + # System checks -check_include_file("libv4l1-videodev.h" HAVE_LIBV4L1_VIDEODEV_H) +check_include_file("libv4l1-videodev.h" _H) if(NOT HAVE_LIBV4L1_VIDEODEV_H) check_include_file("linux/videodev.h" HAVE_LINUX_VIDEODEV_H) endif(NOT HAVE_LIBV4L1_VIDEODEV_H) diff --git a/zoneminder-config.cmake b/zoneminder-config.cmake index 3854dfe31..6dd6fc48a 100644 --- a/zoneminder-config.cmake +++ b/zoneminder-config.cmake @@ -4,6 +4,8 @@ /* This file is used by cmake to create config.h for ZM */ /* General system checks */ +#cmakedefine BSD 1 +#cmakedefine SOLARIS 1 #cmakedefine HAVE_LINUX_VIDEODEV_H 1 #cmakedefine HAVE_LIBV4L1_VIDEODEV_H 1 #cmakedefine HAVE_LINUX_VIDEODEV2_H 1