From 7abe284cb874a9c7a4b07786a111f6db05be0ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 26 May 2018 11:56:57 +0200 Subject: [PATCH] modules: don't fail w/ confusing error if plugin include dir is not found. Introduced by accident when implementing automagic import of static plugins. --- modules/FindMagnum.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index a43d440c3..a6dfb1d37 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -765,8 +765,10 @@ foreach(_component ${Magnum_FIND_COMPONENTS}) mark_as_advanced(_MAGNUM_${_COMPONENT}_INCLUDE_DIR) endif() - # Automatic import of static plugins on CMake >= 3.1 - if(_component MATCHES ${_MAGNUM_PLUGIN_COMPONENTS} AND NOT CMAKE_VERSION VERSION_LESS 3.1) + # Automatic import of static plugins on CMake >= 3.1. Skip in case the + # include dir was not found -- that'll fail later with a proper + # message. + if(_component MATCHES ${_MAGNUM_PLUGIN_COMPONENTS} AND NOT CMAKE_VERSION VERSION_LESS 3.1 AND _MAGNUM_${_COMPONENT}_INCLUDE_DIR) # Automatic import of static plugins file(READ ${_MAGNUM_${_COMPONENT}_INCLUDE_DIR}/configure.h _magnum${_component}Configure) string(FIND "${_magnum${_component}Configure}" "#define MAGNUM_${_COMPONENT}_BUILD_STATIC" _magnum${_component}_BUILD_STATIC)