From b69720d9ad08290d85eb2a71f9e7d194ad1755c8 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Tue, 17 Sep 2013 15:04:45 +0200 Subject: FindGTK2: Add libraries to the GTK2_LIBRARIES variable only when found Some libraries (e.g. gio) are not necessary, and often not available with older GTK2 versions, therefore GTK_LIBRARIES should not contain GTK2_XXX-NOT_FOUND for these libraries. --- Modules/FindGTK2.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake index 738e022..2020c06 100644 --- a/Modules/FindGTK2.cmake +++ b/Modules/FindGTK2.cmake @@ -370,8 +370,10 @@ function(_GTK2_FIND_LIBRARY _var _lib _expand_vc _append_version) set(GTK2_${_var}_LIBRARY ${GTK2_${_var}_LIBRARY} PARENT_SCOPE) set(GTK2_${_var}_FOUND ${GTK2_${_var}_FOUND} PARENT_SCOPE) - set(GTK2_LIBRARIES ${GTK2_LIBRARIES} ${GTK2_${_var}_LIBRARY}) - set(GTK2_LIBRARIES ${GTK2_LIBRARIES} PARENT_SCOPE) + if(GTK2_${_var}_FOUND) + set(GTK2_LIBRARIES ${GTK2_LIBRARIES} ${GTK2_${_var}_LIBRARY}) + set(GTK2_LIBRARIES ${GTK2_LIBRARIES} PARENT_SCOPE) + endif() if(GTK2_DEBUG) message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}] " -- cgit v0.12