From 4af85ef7b00653a367e481d8689fc69e42502020 Mon Sep 17 00:00:00 2001 From: bruneton Date: Wed, 17 Jul 2013 08:01:06 +0000 Subject: [PATCH] CMake: added warning message when the reference variable passed to the macro SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS() is not defined or empty. --- salome_adm/cmake_files/SalomeMacros.cmake | 7 +++++++ 1 file changed, 7 insertions(+) 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) -- 2.39.2