From d041e60d3256d59a4d072de48b52e66c4e3b5b30 Mon Sep 17 00:00:00 2001 From: Florent Castelli Date: Tue, 17 Jan 2017 17:47:19 +0100 Subject: [PATCH] cmake: Only use include directories on actual paths in check_lib --- CMakeTests/CheckLib.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeTests/CheckLib.cmake b/CMakeTests/CheckLib.cmake index ba5e981f45..246e8f80c0 100644 --- a/CMakeTests/CheckLib.cmake +++ b/CMakeTests/CheckLib.cmake @@ -26,10 +26,14 @@ macro(check_lib var pc lib) endif() if(${var}_FOUND) - include_directories(${${var}_INCLUDE_DIRS}) + if(${var}_INCLUDE_DIRS) + include_directories(${${var}_INCLUDE_DIRS}) + endif() # Make sure include directories for headers found using find_path below # are re-added when reconfiguring - include_directories(${${var}_INCLUDE}) + if(${var}_INCLUDE) + include_directories(${${var}_INCLUDE}) + endif() _internal_message("${lib} found") else() find_library(${var} ${lib})