diff options
author | Allen Winter <allen.winter@kdab.com> | 2011-06-30 17:36:45 -0400 |
---|---|---|
committer | Allen Winter <allen.winter@kdab.com> | 2011-06-30 17:36:45 -0400 |
commit | d2b2c90a06bf1f4a21df196430d1f95856900410 (patch) | |
tree | aba9d2a48d7b2ac1e960e1b68218394524c7e6a8 /attic/modules/MacroOptionalDependPackage.cmake | |
parent | e15ffacc69242c89107afbfda6f8ece9f2b56633 (diff) | |
download | extra-cmake-modules-d2b2c90a06bf1f4a21df196430d1f95856900410.tar.gz extra-cmake-modules-d2b2c90a06bf1f4a21df196430d1f95856900410.tar.bz2 |
Move the modules, modules-test and systeminfo subdirs into 'attic'
Diffstat (limited to 'attic/modules/MacroOptionalDependPackage.cmake')
-rw-r--r-- | attic/modules/MacroOptionalDependPackage.cmake | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/attic/modules/MacroOptionalDependPackage.cmake b/attic/modules/MacroOptionalDependPackage.cmake new file mode 100644 index 00000000..2ea79960 --- /dev/null +++ b/attic/modules/MacroOptionalDependPackage.cmake @@ -0,0 +1,22 @@ +# Search if cmake module is installed in computer +# cmake will not fail but signal that we must install depend package before. +# add as previously name of cmake module "_name" and define package needed "_module_needed" +# if return DEPEND_PACKAGE_${_name} + +# Copyright (c) 2007, Montel Laurent <montel@kde.org> +# +# 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_DEPEND_PACKAGE _name _module_needed) + set(_packagename Find${_name}.cmake) + find_file(_PACKAGE_DEPEND_FOUND ${_packagename} PATHS ${CMAKE_MODULE_PATH} ) + if(NOT _PACKAGE_DEPEND_FOUND) + message(STATUS "optional cmake package ${_packagename} (for ${_module_needed}) was not found.") + set(DEPEND_PACKAGE_${_name} FALSE) + else(NOT _PACKAGE_DEPEND_FOUND) + set(DEPEND_PACKAGE_${_name} TRUE) + endif(NOT _PACKAGE_DEPEND_FOUND) +endmacro (MACRO_OPTIONAL_DEPEND_PACKAGE) + |