From 32423cf27bf3a14520e896bd5e1d924fedee86dc Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Wed, 17 Nov 2010 19:14:47 -0600 Subject: [PATCH] binpac: Customizable error messages for missing prereqs. Adds the FindRequiredPackage() macro that wraps the functionality of the standard find_package() macro. --- tools/binpac/CMakeLists.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/binpac/CMakeLists.txt b/tools/binpac/CMakeLists.txt index fb5f5b49ff..ead7550646 100644 --- a/tools/binpac/CMakeLists.txt +++ b/tools/binpac/CMakeLists.txt @@ -45,8 +45,17 @@ endif () ######################################################################## ## Dependency Configuration -find_package(FLEX REQUIRED) -find_package(BISON REQUIRED) +include(FindRequiredPackage) + +FindRequiredPackage(FLEX) +FindRequiredPackage(BISON) + +if (MISSING_PREREQS) + foreach (prereq ${MISSING_PREREQ_DESCS}) + message(SEND_ERROR ${prereq}) + endforeach () + message(FATAL_ERROR "Configuration aborted due to missing prerequisites") +endif () ######################################################################## ## System Introspection