Don't expand variables for test

Use only expansion when comparing the variable against a literal, not
when comparing for logical true or if defined.
This commit is contained in:
Roland Kaufmann 2012-12-12 22:10:32 +01:00
parent 7976b95983
commit c387e04069

View File

@ -171,12 +171,12 @@ file (GLOB_RECURSE tests_SOURCES "tests/*.c" "tests/*.cpp")
# conditionally disable tests when features aren't available
macro (cond_disable_test name)
if ((NOT DEFINED ${HAVE_${name}}) OR (NOT ${HAVE_${name}}))
if ((NOT DEFINED HAVE_${name}) OR (NOT HAVE_${name}))
message (STATUS "${name} test disabled, since ${name} is not found.")
string (TOLOWER "${name}" name_lower)
get_filename_component (test_${name}_FILE "tests/test_${name_lower}.cpp" ABSOLUTE)
list (REMOVE_ITEM tests_SOURCES "${test_${name}_FILE}")
endif ((NOT DEFINED ${HAVE_${name}}) OR (NOT ${HAVE_${name}}))
endif ((NOT DEFINED HAVE_${name}) OR (NOT HAVE_${name}))
endmacro (cond_disable_test name)
cond_disable_test ("AGMG")
cond_disable_test ("ERT")