From ce16450e43339e43cba07be0437d8f621a28157d Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Mon, 18 Mar 2013 10:32:53 +0100 Subject: [PATCH] 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. --- cmake/Modules/OpmPackage.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmake/Modules/OpmPackage.cmake b/cmake/Modules/OpmPackage.cmake index b35fa920..649402f1 100644 --- a/cmake/Modules/OpmPackage.cmake +++ b/cmake/Modules/OpmPackage.cmake @@ -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})