Merge pull request #844 from knnniggett/cmake_hostos

Cmake hostos
pull/845/head
Isaac Connor 2015-05-21 13:14:15 -04:00
commit bf7df97abf
2 changed files with 23 additions and 0 deletions

View File

@ -161,6 +161,27 @@ 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)
if(NOT HAVE_LIBV4L1_VIDEODEV_H)

View File

@ -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