From: bruneton Date: Wed, 2 Oct 2013 12:44:12 +0000 (+0000) Subject: CMake: minor: modified a warning message in the detection macro (an empty reference X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8d7c3f08ec7ec435bc610c726340fbcee874778f;p=modules%2Fyacs.git CMake: minor: modified a warning message in the detection macro (an empty reference variable is now considered valid). --- diff --git a/salome_adm/cmake_files/SalomeMacros.cmake b/salome_adm/cmake_files/SalomeMacros.cmake index 012851b47..2b2eec646 100755 --- a/salome_adm/cmake_files/SalomeMacros.cmake +++ b/salome_adm/cmake_files/SalomeMacros.cmake @@ -509,10 +509,10 @@ MACRO(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS pkg referenceVariable upCount) ## 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 "")) + # First test if the variable exists, warn otherwise: + IF(NOT DEFINED ${referenceVariable}) MESSAGE(WARNING "${pkg}: the reference variable '${referenceVariable}' used when calling the macro " - "SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS() does not exist or is empty.") + "SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS() is not defined.") ENDIF() LIST(LENGTH ${referenceVariable} _tmp_len) @@ -522,9 +522,8 @@ MACRO(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS pkg referenceVariable upCount) # Note the double de-reference of "referenceVariable": SET(_tmp_ROOT_DIR "${${referenceVariable}}") ENDIF() - IF(${upCount}) - MATH(EXPR _rge "${upCount}-1") - FOREACH(_unused RANGE ${_rge}) + IF(${upCount}) + FOREACH(_unused RANGE 1 ${upCount}) GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${_tmp_ROOT_DIR}" PATH) ENDFOREACH() ENDIF()