From a1f9df48d61ccc34e35bf98c3c61ec7861e8e1b6 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Mon, 20 Feb 2017 23:33:50 +0100 Subject: [PATCH] make BUILD_TOXAV and option and fail if dependencies are missing fixes #482 --- CMakeLists.txt | 13 +++++++++---- appveyor.yml | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e7f49313..1f3d77ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() ################################################################################ diff --git a/appveyor.yml b/appveyor.yml index ec90e428..4b4bfb20 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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