From c383c791ece6f71742632157919805506e1e74af Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Sat, 9 Jun 2007 12:11:33 +0000 Subject: This module allows to test if we installed depends package. For some cmake module it is not necessary to move them into kdelibs as FindLibKDEgames which is necessary by playground/games which failed if we didn t install kdegames before. Not it signaled that it depend under other modules. svn path=/trunk/KDE/kdelibs/; revision=673217 --- modules/MacroOptionalDependPackage.cmake | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 modules/MacroOptionalDependPackage.cmake (limited to 'modules') diff --git a/modules/MacroOptionalDependPackage.cmake b/modules/MacroOptionalDependPackage.cmake new file mode 100644 index 00000000..1a6df36a --- /dev/null +++ b/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 +# +# 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 "cmake package ${_packagename} was not found. This package needs ${_module_needed} to be compile all program") + 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) + -- cgit v1.2.1