From: bruneton Date: Wed, 17 Jul 2013 08:01:06 +0000 (+0000) Subject: CMake: added warning message when the reference variable passed to the macro X-Git-Tag: B4KillOfAutomake~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4af85ef7b00653a367e481d8689fc69e42502020;p=modules%2Fkernel.git CMake: added warning message when the reference variable passed to the macro SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS() is not defined or empty. --- diff --git a/salome_adm/cmake_files/SalomeMacros.cmake b/salome_adm/cmake_files/SalomeMacros.cmake index acf423372..6c0a84ebf 100755 --- a/salome_adm/cmake_files/SalomeMacros.cmake +++ b/salome_adm/cmake_files/SalomeMacros.cmake @@ -377,6 +377,13 @@ MACRO(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS pkg referenceVariable upCount) ## 3. Set the root dir which was finally retained by going up "upDir" times ## from the given reference path. The variable "referenceVariable" may be a list. ## In this case we take its first element. + + # First test if the variable exists and is not empty: + IF((NOT DEFINED ${referenceVariable}) OR ("${${referenceVariable}}" STREQUAL "")) + MESSAGE(WARNING "${pkg}: the reference variable '${referenceVariable}' used when calling the macro " + "SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS() does not exist or is empty.") + ENDIF() + LIST(LENGTH ${referenceVariable} _tmp_len) IF(_tmp_len) LIST(GET ${referenceVariable} 0 _tmp_ROOT_DIR)