From cb8f0f7c813f718bf8a8f8896b52de03bc9c6106 Mon Sep 17 00:00:00 2001 From: Chuck Atkins Date: Mon, 1 Sep 2014 13:40:27 -0400 Subject: [PATCH] FindGTK2: Fix missing optional include dirs. FindGTK2 was adding optional include directories to the interface include dirs regardless of whether or not they existed. This ensures that the directories only get added if they are actually found. This is particularly a problem on Solaris where the gtk2 libs and headers might exist but the FreeType2 headers might not. --- Modules/FindGTK2.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake index eaa5e550e..67dc0ebdc 100644 --- a/Modules/FindGTK2.cmake +++ b/Modules/FindGTK2.cmake @@ -540,7 +540,11 @@ function(_GTK2_ADD_TARGET _var) endif() if(_${_var}_OPTIONAL_INCLUDES) - _GTK2_ADD_TARGET_INCLUDE_DIRS(${_var} ${_${_var}_OPTIONAL_INCLUDES}) + foreach(_D ${_${_var}_OPTIONAL_INCLUDES}) + if(_D) + _GTK2_ADD_TARGET_INCLUDE_DIRS(${_var} ${_D}) + endif() + endforeach() endif() if(GTK2_USE_IMPORTED_TARGETS)