cmake_modules/utils.cmake
changeset 8688 88a6114a318c
parent 8686 d303da4568b7
child 8772 c9583cf8e10d
child 9220 5e7db24f3489
--- a/cmake_modules/utils.cmake	Thu Mar 07 10:16:21 2013 +0100
+++ b/cmake_modules/utils.cmake	Thu Mar 07 11:55:00 2013 +0100
@@ -15,5 +15,16 @@
     endif(NOT ${_PKG_NAME_UP}_FOUND)
 endmacro(find_package_or_disable _PKG_NAME _VAR_NAME)
 
+macro(find_package_or_disable_msg _PKG_NAME _VAR_NAME _MSG)
+    if(NOT ${_VAR_NAME})
+        find_package_or_disable(${_PKG_NAME} ${_VAR_NAME})
+    else(NOT ${_VAR_NAME})
+        message(STATUS "${_PKG_NAME} disabled. ${_MSG}")
+        string(TOUPPER ${_PKG_NAME} _PKG_NAME_UP)
+        set(${_PKG_NAME_UP}_FOUND false)
+    endif(NOT ${_VAR_NAME})
+endmacro(find_package_or_disable_msg _PKG_NAME _VAR_NAME _MSG)
+
+
 #TODO: find_package_or_bundle