From 5c70b482e7e7698ef23fc90db851925109d4a991 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 17 Jul 2012 21:22:45 +0200 Subject: [PATCH] Fail when Qt4 is not found and BUILD_TESTS is set to true. It's up to user to disable building of tests if Qt4 is not found, instead of failing silently without user noticing it. --- CMakeLists.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 014b64876..1af8506cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,11 +10,10 @@ if(BUILD_TESTS) find_package(Qt4) if(NOT QT4_FOUND) - message(WARNING "Qt4 is required for building unit tests. No tests will be build.") - set(BUILD_TESTS OFF) - else() - enable_testing() + message(FATAL_ERROR "Qt4, required for building unit tests, was not found. Set BUILD_TESTS to OFF to skip building them.") endif() + + enable_testing() endif() set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${Magnum_SOURCE_DIR}/modules/")