Bugfix change from function to macro

This change is similar to commit 89be4e14: After find_package_append_to
changed from function to macro to pick up the configuration not only
from the module itself but also from everything it pulled it, the
variable MODULE is overwritten (variable module in lower case is a
parameter, so it is replaced in the source body). Thus, the test in the
end is not whether *this* module was found, but if its last dependency
was! This made the build crash only in some projects but not in others.
This commit is contained in:
Roland Kaufmann 2013-03-18 10:32:53 +01:00
parent d86b4c09a4
commit ce16450e43

View File

@ -136,6 +136,13 @@ macro (find_opm_package module deps header lib defs prog conf)
list (APPEND _deps ${_name_only})
endforeach (_dep)
# since find_and_append_package_to is a macro, this variable have
# probably been overwritten (due to its common name); it is now
# this module's last dependency instead of the name of the module
# itself, so it must be restored
string (TOUPPER ${module} MODULE_UPPER)
string (REPLACE "-" "_" MODULE ${MODULE_UPPER})
# compile with this option to avoid avalanche of warnings
set (${module}_DEFINITIONS "${${module}_DEFINITIONS}")
foreach (_def IN ITEMS ${defs})