summaryrefslogtreecommitdiff
path: root/Modules/FindGTK2.cmake
diff options
context:
space:
mode:
authorChuck Atkins <chuck.atkins@kitware.com>2014-09-01 13:40:27 -0400
committerChuck Atkins <chuck.atkins@kitware.com>2014-09-03 23:25:57 -0400
commitcb8f0f7c813f718bf8a8f8896b52de03bc9c6106 (patch)
tree77b8159e5daf7720384bd43b21b98d9a29187507 /Modules/FindGTK2.cmake
parent75abb6da979b4abfaf5e00b32c81239116fa2406 (diff)
downloadcmake-cb8f0f7c813f718bf8a8f8896b52de03bc9c6106.tar.gz
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.
Diffstat (limited to 'Modules/FindGTK2.cmake')
-rw-r--r--Modules/FindGTK2.cmake6
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake
index eaa5e550e1..67dc0ebdcf 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)