summaryrefslogtreecommitdiffstats
path: root/Modules/FindGTK2.cmake
diff options
context:
space:
mode:
authorDaniele E. Domenichelli <daniele.domenichelli@iit.it>2013-08-02 16:16:48 (GMT)
committerBrad King <brad.king@kitware.com>2013-10-08 00:19:29 (GMT)
commit0bc3763c9ed0b34de78f359b723402245df77e2e (patch)
tree428e873c24f109190a23508aef93418bb09d660a /Modules/FindGTK2.cmake
parent9905abd1507046e56c002274103c41d4c83381a3 (diff)
downloadCMake-0bc3763c9ed0b34de78f359b723402245df77e2e.zip
CMake-0bc3763c9ed0b34de78f359b723402245df77e2e.tar.gz
CMake-0bc3763c9ed0b34de78f359b723402245df77e2e.tar.bz2
FindGTK2: Better handling of include directories
Add a method _GTK2_ADD_TARGET_INCLUDE_DIRS to handle it.
Diffstat (limited to 'Modules/FindGTK2.cmake')
-rw-r--r--Modules/FindGTK2.cmake28
1 files changed, 15 insertions, 13 deletions
diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake
index e36a874..057cd9a 100644
--- a/Modules/FindGTK2.cmake
+++ b/Modules/FindGTK2.cmake
@@ -466,6 +466,15 @@ function(_GTK2_ADD_TARGET_DEPENDS _var)
endforeach()
endfunction()
+function(_GTK2_ADD_TARGET_INCLUDE_DIRS _var)
+ string(REGEX REPLACE "GTK2_" "" _basename "${_var}")
+ string(TOLOWER "${_basename}" _basename)
+ if(TARGET GTK2::${_basename})
+ foreach(_include ${ARGN})
+ set_property(TARGET GTK2::${_basename} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${_include}")
+ endforeach()
+ endif()
+endfunction()
#=============================================================
@@ -626,9 +635,7 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
_GTK2_ADD_TARGET_DEPENDS(GTK2_GTHREAD glib)
_GTK2_ADD_TARGET_DEPENDS(GTK2_GMODULE glib)
_GTK2_ADD_TARGET_DEPENDS(GTK2_GDK_PIXBUF gobject glib)
- #_GTK2_ADD_TARGET_DEPENDS(GTK2_CAIRO)
- set_property(TARGET GTK2::cairo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${FREETYPE_INCLUDE_DIRS}")
- set_property(TARGET GTK2::cairo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${GTK2_FONTCONFIG_INCLUDE_DIRS}")
+ _GTK2_ADD_TARGET_INCLUDE_DIRS(GTK2_CAIRO ${FREETYPE_INCLUDE_DIRS} ${GTK2_FONTCONFIG_INCLUDE_DIRS})
_GTK2_ADD_TARGET_DEPENDS(GTK2_PANGO gobject glib)
_GTK2_ADD_TARGET_DEPENDS(GTK2_PANGOCAIRO pango cairo gobject glib)
_GTK2_ADD_TARGET_DEPENDS(GTK2_GDK pangocairo pango cairo gdk_pixbuf gobject glib)
@@ -675,18 +682,15 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
_GTK2_FIND_LIBRARY (GTK2_SIGC++ sigc true true)
_GTK2_ADJUST_LIB_VARS (GTK2_SIGC++)
- #_GTK2_ADD_TARGET_DEPENDS(GTK2_SIGC++)
_GTK2_ADD_TARGET_DEPENDS(GTK2_GLIBMM gobject sigc glib)
_GTK2_ADD_TARGET_DEPENDS(GTK2_GIOMM gio glibmm gobject sigc glib)
_GTK2_ADD_TARGET_DEPENDS(GTK2_ATKMM atk glibmm gobject sigc glib)
_GTK2_ADD_TARGET_DEPENDS(GTK2_CAIROMM cairo sigc++)
_GTK2_ADD_TARGET_DEPENDS(GTK2_PANGOMM glibmm cairomm pangocairo sigc++ pango cairo gobject glib)
_GTK2_ADD_TARGET_DEPENDS(GTK2_GDKMM giomm pangomm gtk glibmm cairomm sigc++ gdk atk gio pangoft2 pangocairo gdk_pixbuf cairo pango gobject glib)
- set_property(TARGET GTK2::gtkmm APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${FREETYPE_INCLUDE_DIRS}")
- set_property(TARGET GTK2::gtkmm APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${GTK2_FONTCONFIG_INCLUDE_DIRS}")
+ _GTK2_ADD_TARGET_INCLUDE_DIRS(GTK2_GDKMM ${FREETYPE_INCLUDE_DIRS} ${GTK2_FONTCONFIG_INCLUDE_DIRS})
_GTK2_ADD_TARGET_DEPENDS(GTK2_GTKMM atkmm gdkmm giomm pangomm gtk glibmm cairomm sigc++ gdk atk gio pangoft2 pangocairo gdk_pixbuf cairo pango gthread gobject glib)
- set_property(TARGET GTK2::gtkmm APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${FREETYPE_INCLUDE_DIRS}")
- set_property(TARGET GTK2::gtkmm APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${GTK2_FONTCONFIG_INCLUDE_DIRS}")
+ _GTK2_ADD_TARGET_INCLUDE_DIRS(GTK2_GTKMM ${FREETYPE_INCLUDE_DIRS} ${GTK2_FONTCONFIG_INCLUDE_DIRS})
elseif(_GTK2_component STREQUAL "glade")
@@ -694,8 +698,7 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
_GTK2_FIND_LIBRARY (GTK2_GLADE glade false true)
_GTK2_ADJUST_LIB_VARS (GTK2_GLADE)
_GTK2_ADD_TARGET_DEPENDS(GTK2_GLADE gtk gdk atk gio pangoft2 pangocairo gdk_pixbuf cairo pango gobject glib)
- set_property(TARGET GTK2::glade APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${FREETYPE_INCLUDE_DIRS}")
- set_property(TARGET GTK2::glade APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${GTK2_FONTCONFIG_INCLUDE_DIRS}")
+ _GTK2_ADD_TARGET_INCLUDE_DIRS(GTK2_GLADE ${FREETYPE_INCLUDE_DIRS} ${GTK2_FONTCONFIG_INCLUDE_DIRS})
elseif(_GTK2_component STREQUAL "glademm")
@@ -703,9 +706,8 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
_GTK2_FIND_INCLUDE_DIR(GTK2_GLADEMMCONFIG libglademmconfig.h)
_GTK2_FIND_LIBRARY (GTK2_GLADEMM glademm true true)
_GTK2_ADJUST_LIB_VARS (GTK2_GLADEMM)
- _GTK2_ADD_TARGET_DEPENDS(GLADEMM gtkmm glade atkmm gdkmm giomm pangomm glibmm cairomm sigc++ gtk gdk atk gio pangoft pangocairo gdk_pixbuf cairo pango gthread gobject glib)
- set_property(TARGET GTK2::glademm APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${FREETYPE_INCLUDE_DIRS}")
- set_property(TARGET GTK2::glademm APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${GTK2_FONTCONFIG_INCLUDE_DIRS}")
+ _GTK2_ADD_TARGET_DEPENDS(GTK2_GLADEMM gtkmm glade atkmm gdkmm giomm pangomm glibmm cairomm sigc++ gtk gdk atk gio pangoft pangocairo gdk_pixbuf cairo pango gthread gobject glib)
+ _GTK2_ADD_TARGET_INCLUDE_DIRS(GTK2_GLADEMM ${FREETYPE_INCLUDE_DIRS} ${GTK2_FONTCONFIG_INCLUDE_DIRS})
else()
message(FATAL_ERROR "Unknown GTK2 component ${_component}")