make BUILD_TOXAV and option and fail if dependencies are missing

fixes #482
This commit is contained in:
Carsten Brandt 2017-02-20 23:33:50 +01:00
parent 63df16728c
commit a1f9df48d6
No known key found for this signature in database
GPG Key ID: BE4F41DE1DEEEED0
2 changed files with 10 additions and 5 deletions

View File

@ -170,12 +170,17 @@ if(ASAN)
set(CMAKE_REQUIRED_LIBRARIES "${SAFE_CMAKE_REQUIRED_LIBRARIES}")
endif()
option(BUILD_TOXAV "Whether to build the tox AV library" ON)
include(Dependencies)
if(OPUS_FOUND AND VPX_FOUND)
set(BUILD_TOXAV TRUE)
else()
set(BUILD_TOXAV FALSE)
if (BUILD_TOXAV)
if(NOT OPUS_FOUND)
message(SEND_ERROR "Option BUILD_TOXAV is enabled but required library OPUS was not found.")
endif()
if(NOT VPX_FOUND)
message(SEND_ERROR "Option BUILD_TOXAV is enabled but required library VPX was not found.")
endif()
endif()
################################################################################

View File

@ -13,7 +13,7 @@ install:
- cd ..
before_build:
- cmake . -DBOOTSTRAP_DAEMON=OFF -DENABLE_SHARED=OFF
- cmake . -DBOOTSTRAP_DAEMON=OFF -DENABLE_SHARED=OFF -DBUILD_TOXAV=OFF
build:
project: INSTALL.vcxproj