From ceea23677c61f20759ae986bd77b0d5c4d673edb Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 17 Feb 2010 00:43:50 +0000 Subject: Added old KDE3 version of kbfx git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kbfx@1091549 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- cmakemodules/MacroOptionalFindPackage.cmake | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 cmakemodules/MacroOptionalFindPackage.cmake (limited to 'cmakemodules/MacroOptionalFindPackage.cmake') diff --git a/cmakemodules/MacroOptionalFindPackage.cmake b/cmakemodules/MacroOptionalFindPackage.cmake new file mode 100644 index 0000000..816cdb7 --- /dev/null +++ b/cmakemodules/MacroOptionalFindPackage.cmake @@ -0,0 +1,28 @@ +# - MACRO_OPTIONAL_FIND_PACKAGE() combines FIND_PACKAGE() with an OPTION() +# MACRO_OPTIONAL_FIND_PACKAGE( [QUIT] ) +# This macro is a combination of OPTION() and FIND_PACKAGE(), it +# works like FIND_PACKAGE(), but additionally it automatically creates +# an option name WITH_, which can be disabled via the cmake GUI. +# or via -DWITH_=OFF +# The standard _FOUND variables can be used in the same way +# as when using the normal FIND_PACKAGE() + +# Copyright (c) 2006, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +MACRO (MACRO_OPTIONAL_FIND_PACKAGE _name ) + OPTION(WITH_${_name} "Search for ${_name} package" ON) + if (WITH_${_name}) + FIND_PACKAGE(${_name} ${ARGN}) + else (WITH_${_name}) + set(${_name}_FOUND) + set(${_name}_INCLUDE_DIR) + set(${_name}_INCLUDES) + set(${_name}_LIBRARY) + set(${_name}_LIBRARIES) + endif (WITH_${_name}) +ENDMACRO (MACRO_OPTIONAL_FIND_PACKAGE) + -- cgit v1.2.1