diff --git a/cmake/modules/DuneMacros.cmake b/cmake/modules/DuneMacros.cmake index e2a4bcd2ddd0e5321184ae21559f13fad319dd4f..29c2723909274ba636a00272f6c357e0ef511fb3 100644 --- a/cmake/modules/DuneMacros.cmake +++ b/cmake/modules/DuneMacros.cmake @@ -102,7 +102,8 @@ macro(find_dune_package module) # use pkg-config find_package(PkgConfig REQUIRED) pkg_check_modules (${module} ${module}) - if(NOT ${module}_FOUND) + # error out if required module is not found + if((NOT ${module}_FOUND) AND (${ARGV} MATCHES ".*REQUIRED")) message(FATAL_ERROR "Could not find module ${module}.") endif() # compute the path to the libraries