aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Montel <montel@kde.org>2007-06-09 12:11:33 +0000
committerLaurent Montel <montel@kde.org>2007-06-09 12:11:33 +0000
commitc383c791ece6f71742632157919805506e1e74af (patch)
tree791572f15ba1755f6b33d0c031a9a80bda4c9dc4
parentc6ad4ece89f2b5437f0017a815d2c1ec8c3d9cd0 (diff)
downloadextra-cmake-modules-c383c791ece6f71742632157919805506e1e74af.tar.gz
extra-cmake-modules-c383c791ece6f71742632157919805506e1e74af.tar.bz2
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
-rw-r--r--modules/MacroOptionalDependPackage.cmake22
1 files changed, 22 insertions, 0 deletions
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 <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 "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)
+