[Cmake-commits] CMake branch, next, updated. v2.8.11.2-3767-g4532f68

Daniele E. Domenichelli daniele.domenichelli at gmail.com
Wed Aug 7 12:56:33 EDT 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  4532f68df85fc1ee5083029de8cd26af0c984370 (commit)
       via  893c5c1befd317473ac294f4998ec6d02198ddb0 (commit)
       via  e3003f65664f5171b9dc5abc219bc3d2dce9d4c1 (commit)
       via  8442a39775cb392485c27636fcc0877cce7ca01b (commit)
       via  7c3adb07986c24b8081558b2cd807f30a3b7e01d (commit)
       via  ab5f03d730aaa3c658bff0d3c82008da8037bc7f (commit)
       via  eeecbe65401e4600fa9a8f3ba10abea68d1b6a9b (commit)
       via  ed14da39c51bc6cc6efc1551e0c55679798fde5f (commit)
       via  fc3b60dfbb4b9525662b3301ecb547d025e04ee8 (commit)
      from  dfbc7873da9ef0e5ec0267d20de7bdf41f12b54f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4532f68df85fc1ee5083029de8cd26af0c984370
commit 4532f68df85fc1ee5083029de8cd26af0c984370
Merge: dfbc787 893c5c1
Author:     Daniele E. Domenichelli <daniele.domenichelli at gmail.com>
AuthorDate: Wed Aug 7 12:55:59 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Aug 7 12:55:59 2013 -0400

    Merge topic 'FindGTK2-targets' into next
    
    893c5c1 FindGTK2: Add unit tests for gtk and gtkmm targets
    e3003f6 FindGTK2: Small cleanup
    8442a39 FindGTK2: Do not require the GTK_ prefix in all the internal functions
    7c3adb0 FindGTK2: Better handling of include directories
    ab5f03d FindGTK2: Create targets for each library
    eeecbe6 FindGTK2: Search for glib-object.h instead of gobject/gobject.h
    ed14da3 FindGTK2: Populate GTK2_DEFINITIONS before searching for libraries
    fc3b60d FindGTK2: Export GTK2_XXX_FOUND to parent scope in _GTK2_FIND_LIBRARY


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=893c5c1befd317473ac294f4998ec6d02198ddb0
commit 893c5c1befd317473ac294f4998ec6d02198ddb0
Author:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
AuthorDate: Tue Aug 6 11:33:59 2013 +0200
Commit:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
CommitDate: Tue Aug 6 11:33:59 2013 +0200

    FindGTK2: Add unit tests for gtk and gtkmm targets

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 16693de..d6d328b 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1069,6 +1069,36 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     endif()
   endif()
 
+  if(NOT GTK2_FOUND)
+    find_package(GTK2 COMPONENTS gtk glade gtkmm glademm QUIET)
+  endif()
+
+  if(GTK2_GTK_FOUND)
+     add_test(GTK2Gtk ${CMAKE_CTEST_COMMAND}
+       --build-and-test
+       "${CMake_SOURCE_DIR}/Tests/GTK2Gtk"
+       "${CMake_BINARY_DIR}/Tests/GTK2Gtk"
+       ${build_generator_args}
+       --build-project GTK2Gtk
+       --build-exe-dir "${CMake_BINARY_DIR}/Tests/GTK2Gtk"
+       --force-new-ctest-process
+       --test-command ${CMAKE_CTEST_COMMAND} -V
+       )
+  endif()
+
+  if(GTK2_GTKMM_FOUND)
+     add_test(GTK2GtkMM ${CMAKE_CTEST_COMMAND}
+       --build-and-test
+       "${CMake_SOURCE_DIR}/Tests/GTK2GtkMM"
+       "${CMake_BINARY_DIR}/Tests/GTK2GtkMM"
+        ${build_generator_args}
+       --build-project GTK2GtkMM
+       --build-exe-dir "${CMake_BINARY_DIR}/Tests/GTK2GtkMM"
+       --force-new-ctest-process
+       --test-command ${CMAKE_CTEST_COMMAND} -V
+       )
+  endif()
+
   add_test(ExternalProject ${CMAKE_CTEST_COMMAND}
     --build-and-test
     "${CMake_SOURCE_DIR}/Tests/ExternalProject"
diff --git a/Tests/GTK2Gtk/CMakeLists.txt b/Tests/GTK2Gtk/CMakeLists.txt
new file mode 100644
index 0000000..30ab706
--- /dev/null
+++ b/Tests/GTK2Gtk/CMakeLists.txt
@@ -0,0 +1,10 @@
+cmake_minimum_required(VERSION 2.8)
+
+project(GTK2Gtk)
+
+find_package(GTK2 COMPONENTS gtk REQUIRED)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+add_executable(GTK2Gtk WIN32 main.c)
+target_link_libraries(GTK2Gtk GTK2::gtk)
diff --git a/Tests/GTK2Gtk/main.c b/Tests/GTK2Gtk/main.c
new file mode 100644
index 0000000..309c328
--- /dev/null
+++ b/Tests/GTK2Gtk/main.c
@@ -0,0 +1,15 @@
+#include <gtk/gtk.h>
+
+int main(int argc, char *argv[])
+{
+    GtkWidget *window;
+
+    gtk_init (&argc, &argv);
+
+    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+    gtk_widget_show  (window);
+
+    gtk_main ();
+
+    return 0;
+}
diff --git a/Tests/GTK2GtkMM/CMakeLists.txt b/Tests/GTK2GtkMM/CMakeLists.txt
new file mode 100644
index 0000000..017f884
--- /dev/null
+++ b/Tests/GTK2GtkMM/CMakeLists.txt
@@ -0,0 +1,10 @@
+cmake_minimum_required(VERSION 2.8)
+
+project(GTK2GtkMM)
+
+find_package(GTK2 COMPONENTS gtk gtkmm REQUIRED)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+add_executable(GTK2GtkMM WIN32 main.cpp helloworld.cpp helloworld.h)
+target_link_libraries(GTK2GtkMM GTK2::gtkmm)
diff --git a/Tests/GTK2GtkMM/helloworld.cpp b/Tests/GTK2GtkMM/helloworld.cpp
new file mode 100644
index 0000000..535f44a
--- /dev/null
+++ b/Tests/GTK2GtkMM/helloworld.cpp
@@ -0,0 +1,29 @@
+#include "helloworld.h"
+#include <iostream>
+
+HelloWorld::HelloWorld()
+    : m_button("Hello World")   // creates a new button with label "Hello World".
+{
+    // Sets the border width of the window.
+    set_border_width(10);
+
+    // When the button receives the "clicked" signal, it will call the
+    // on_button_clicked() method defined below.
+    m_button.signal_clicked().connect(sigc::mem_fun(*this,
+                                      &HelloWorld::on_button_clicked));
+
+    // This packs the button into the Window (a container).
+    add(m_button);
+
+    // The final step is to display this newly created widget...
+    m_button.show();
+}
+
+HelloWorld::~HelloWorld()
+{
+}
+
+void HelloWorld::on_button_clicked()
+{
+    std::cout << "Hello World" << std::endl;
+}
diff --git a/Tests/GTK2GtkMM/helloworld.h b/Tests/GTK2GtkMM/helloworld.h
new file mode 100644
index 0000000..ab9a076
--- /dev/null
+++ b/Tests/GTK2GtkMM/helloworld.h
@@ -0,0 +1,20 @@
+#ifndef GTKMM_EXAMPLE_HELLOWORLD_H
+#define GTKMM_EXAMPLE_HELLOWORLD_H
+
+#include <gtkmm.h>
+
+class HelloWorld : public Gtk::Window
+{
+public:
+    HelloWorld();
+    virtual ~HelloWorld();
+
+protected:
+    //Signal handlers:
+    void on_button_clicked();
+
+    //Member widgets:
+    Gtk::Button m_button;
+};
+
+#endif // GTKMM_EXAMPLE_HELLOWORLD_H
diff --git a/Tests/GTK2GtkMM/main.cpp b/Tests/GTK2GtkMM/main.cpp
new file mode 100644
index 0000000..0df7d54
--- /dev/null
+++ b/Tests/GTK2GtkMM/main.cpp
@@ -0,0 +1,13 @@
+#include <gtkmm.h>
+#include "helloworld.h"
+
+int main (int argc, char *argv[])
+{
+    Gtk::Main kit(argc, argv);
+
+    HelloWorld helloworld;
+    //Shows the window and returns when it is closed.
+    Gtk::Main::run(helloworld);
+
+    return 0;
+}

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e3003f65664f5171b9dc5abc219bc3d2dce9d4c1
commit e3003f65664f5171b9dc5abc219bc3d2dce9d4c1
Author:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
AuthorDate: Fri Aug 2 18:06:34 2013 +0200
Commit:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
CommitDate: Mon Aug 5 16:49:19 2013 +0200

    FindGTK2: Small cleanup

diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake
index 195bb4b..d5b0f35 100644
--- a/Modules/FindGTK2.cmake
+++ b/Modules/FindGTK2.cmake
@@ -763,7 +763,6 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
             GTK2_GLIBMM_INCLUDE_DIR
             GTK2_GLIBMMCONFIG_INCLUDE_DIR
             GTK2_GLIBMM_LIBRARY
-
         )
     elseif(_GTK2_component STREQUAL "glade")
         FIND_PACKAGE_HANDLE_STANDARD_ARGS(GTK2_${_COMPONENT_UPPER} "The glade library was not found."

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8442a39775cb392485c27636fcc0877cce7ca01b
commit 8442a39775cb392485c27636fcc0877cce7ca01b
Author:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
AuthorDate: Fri Aug 2 18:04:36 2013 +0200
Commit:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
CommitDate: Mon Aug 5 16:49:19 2013 +0200

    FindGTK2: Do not require the GTK_ prefix in all the internal functions
    
    This saves from using string(REGEXP) to create targets

diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake
index 75fec1b..195bb4b 100644
--- a/Modules/FindGTK2.cmake
+++ b/Modules/FindGTK2.cmake
@@ -215,7 +215,7 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr)
         message(STATUS "Adding ${_gtk2_arch_dir} to search path for multiarch support")
       endif()
     endif()
-    find_path(${_var}_INCLUDE_DIR ${_hdr}
+    find_path(GTK2_${_var}_INCLUDE_DIR ${_hdr}
         PATHS
             ${_gtk2_arch_dir}
             /usr/local/lib64
@@ -242,8 +242,8 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr)
             ${_suffixes}
     )
 
-    if(${_var}_INCLUDE_DIR)
-        set(GTK2_INCLUDE_DIRS ${GTK2_INCLUDE_DIRS} ${${_var}_INCLUDE_DIR} PARENT_SCOPE)
+    if(GTK2_${_var}_INCLUDE_DIR)
+        set(GTK2_INCLUDE_DIRS ${GTK2_INCLUDE_DIRS} ${GTK2_${_var}_INCLUDE_DIR} PARENT_SCOPE)
     endif()
 
 endfunction()
@@ -333,10 +333,10 @@ function(_GTK2_FIND_LIBRARY _var _lib _expand_vc _append_version)
 
     if(GTK2_DEBUG)
         message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}]     "
-                       "While searching for ${_var}_LIBRARY, our proposed library list is ${_lib_list}")
+                       "While searching for GTK2_${_var}_LIBRARY, our proposed library list is ${_lib_list}")
     endif()
 
-    find_library(${_var}_LIBRARY_RELEASE
+    find_library(GTK2_${_var}_LIBRARY_RELEASE
         NAMES ${_lib_list}
         PATHS
             /opt/gnome/lib
@@ -350,10 +350,10 @@ function(_GTK2_FIND_LIBRARY _var _lib _expand_vc _append_version)
     if(_expand_vc AND MSVC)
         if(GTK2_DEBUG)
             message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}]     "
-                           "While searching for ${_var}_LIBRARY_DEBUG our proposed library list is ${_libd_list}")
+                           "While searching for GTK2_${_var}_LIBRARY_DEBUG our proposed library list is ${_libd_list}")
         endif()
 
-        find_library(${_var}_LIBRARY_DEBUG
+        find_library(GTK2_${_var}_LIBRARY_DEBUG
             NAMES ${_libd_list}
             PATHS
             $ENV{GTKMM_BASEPATH}/lib
@@ -362,23 +362,23 @@ function(_GTK2_FIND_LIBRARY _var _lib _expand_vc _append_version)
         )
     endif()
 
-    select_library_configurations(${_var})
+    select_library_configurations(GTK2_${_var})
 
-    set(${_var}_LIBRARY ${${_var}_LIBRARY} PARENT_SCOPE)
-    set(${_var}_FOUND ${${_var}_FOUND} PARENT_SCOPE)
+    set(GTK2_${_var}_LIBRARY ${GTK2_${_var}_LIBRARY} PARENT_SCOPE)
+    set(GTK2_${_var}_FOUND ${GTK2_${_var}_FOUND} PARENT_SCOPE)
 
-    set(GTK2_LIBRARIES ${GTK2_LIBRARIES} ${${_var}_LIBRARY})
+    set(GTK2_LIBRARIES ${GTK2_LIBRARIES} ${GTK2_${_var}_LIBRARY})
     set(GTK2_LIBRARIES ${GTK2_LIBRARIES} PARENT_SCOPE)
 
     if(GTK2_DEBUG)
         message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}]     "
-                       "${_var}_LIBRARY_RELEASE = \"${${_var}_LIBRARY_RELEASE}\"")
+                       "GTK2_${_var}_LIBRARY_RELEASE = \"${GTK2_${_var}_LIBRARY_RELEASE}\"")
         message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}]     "
-                       "${_var}_LIBRARY_DEBUG   = \"${${_var}_LIBRARY_DEBUG}\"")
+                       "GTK2_${_var}_LIBRARY_DEBUG   = \"${GTK2_${_var}_LIBRARY_DEBUG}\"")
         message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}]     "
-                       "${_var}_LIBRARY         = \"${${_var}_LIBRARY}\"")
+                       "GTK2_${_var}_LIBRARY         = \"${GTK2_${_var}_LIBRARY}\"")
         message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}]     "
-                       "${_var}_FOUND           = \"${${_var}_FOUND}\"")
+                       "GTK2_${_var}_FOUND           = \"${GTK2_${_var}_FOUND}\"")
     endif()
 
 endfunction()
@@ -394,34 +394,33 @@ function(_GTK2_ADJUST_LIB_VARS _var)
                        "_GTK2_ADJUST_LIB_VARS( ${_var} )")
     endif()
 
-    string(REGEX REPLACE "GTK2_" "" _basename "${_var}")
-    string(TOLOWER "${_basename}" _basename)
+    string(TOLOWER "${_var}" _basename)
 
-    if(${_var}_FOUND AND NOT TARGET GTK2::${_basename})
+    if(GTK2_${_var}_FOUND AND NOT TARGET GTK2::${_basename})
         add_library(GTK2::${_basename} UNKNOWN IMPORTED)
 
-        if(${_var}_LIBRARY_RELEASE)
+        if(GTK2_${_var}_LIBRARY_RELEASE)
             set_property(TARGET GTK2::${_basename} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
-            set_property(TARGET GTK2::${_basename}        PROPERTY IMPORTED_LOCATION_RELEASE "${${_var}_LIBRARY_RELEASE}" )
+            set_property(TARGET GTK2::${_basename}        PROPERTY IMPORTED_LOCATION_RELEASE "${GTK2_${_var}_LIBRARY_RELEASE}" )
         endif()
 
-        if(${_var}_LIBRARY_DEBUG)
+        if(GTK2_${_var}_LIBRARY_DEBUG)
             set_property(TARGET GTK2::${_basename} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
-            set_property(TARGET GTK2::${_basename}        PROPERTY IMPORTED_LOCATION_DEBUG "${${_var}_LIBRARY_DEBUG}" )
+            set_property(TARGET GTK2::${_basename}        PROPERTY IMPORTED_LOCATION_DEBUG "${GTK2_${_var}_LIBRARY_DEBUG}" )
         endif()
 
-        if(${_var}_INCLUDE_DIR)
-            set_property(TARGET GTK2::${_basename} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${${_var}_INCLUDE_DIR}")
+        if(GTK2_${_var}_INCLUDE_DIR)
+            set_property(TARGET GTK2::${_basename} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${GTK2_${_var}_INCLUDE_DIR}")
         endif()
 
-        if(${_var}CONFIG_INCLUDE_DIR)
-            set_property(TARGET GTK2::${_basename} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${${_var}CONFIG_INCLUDE_DIR}")
+        if(GTK2_${_var}CONFIG_INCLUDE_DIR)
+            set_property(TARGET GTK2::${_basename} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${GTK2_${_var}CONFIG_INCLUDE_DIR}")
         endif()
 
         set_property(TARGET GTK2::${_basename} PROPERTY INTERFACE_COMPILE_DEFINITIONS "${GTK2_DEFINITIONS}")
 
         if(GTK2_USE_IMPORTED_TARGETS)
-            set(${_var}_LIBRARY GTK2::${_basename} PARENT_SCOPE)
+            set(GTK2_${_var}_LIBRARY GTK2::${_basename} PARENT_SCOPE)
         endif()
     endif()
 endfunction()
@@ -432,8 +431,7 @@ function(_GTK2_ADD_TARGET_DEPENDS_INTERNAL _var _property)
                        "_GTK2_ADD_TARGET_DEPENDS_INTERNAL( ${_var} ${_property} )")
     endif()
 
-    string(REGEX REPLACE "GTK2_" "" _basename "${_var}")
-    string(TOLOWER "${_basename}" _basename)
+    string(TOLOWER "${_var}" _basename)
 
     if (TARGET GTK2::${_basename})
         foreach(_depend ${ARGN})
@@ -455,8 +453,7 @@ function(_GTK2_ADD_TARGET_DEPENDS _var)
                        "_GTK2_ADD_TARGET_DEPENDS( ${_var} )")
     endif()
 
-    string(REGEX REPLACE "GTK2_" "" _basename "${_var}")
-    string(TOLOWER "${_basename}" _basename)
+    string(TOLOWER "${_var}" _basename)
 
     get_target_property(_configs GTK2::${_basename} IMPORTED_CONFIGURATIONS)
     _GTK2_ADD_TARGET_DEPENDS_INTERNAL(${_var} INTERFACE_LINK_LIBRARIES ${ARGN})
@@ -466,8 +463,13 @@ function(_GTK2_ADD_TARGET_DEPENDS _var)
 endfunction()
 
 function(_GTK2_ADD_TARGET_INCLUDE_DIRS _var)
-    string(REGEX REPLACE "GTK2_" "" _basename "${_var}")
-    string(TOLOWER "${_basename}" _basename)
+    if(GTK2_DEBUG)
+        message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}] "
+                       "_GTK2_ADD_TARGET_INCLUDE_DIRS( ${_var} )")
+    endif()
+
+    string(TOLOWER "${_var}" _basename)
+
     if(TARGET GTK2::${_basename})
         foreach(_include ${ARGN})
             set_property(TARGET GTK2::${_basename} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${_include}")
@@ -501,7 +503,7 @@ if(GTK2_FIND_VERSION)
         message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}] "
                        "Searching for version ${GTK2_FIND_VERSION}")
     endif()
-    _GTK2_FIND_INCLUDE_DIR(GTK2_GTK gtk/gtk.h)
+    _GTK2_FIND_INCLUDE_DIR(GTK gtk/gtk.h)
     if(GTK2_GTK_INCLUDE_DIR)
         _GTK2_GET_VERSION(GTK2_MAJOR_VERSION
                           GTK2_MINOR_VERSION
@@ -565,148 +567,148 @@ list(APPEND GTK2_LIBRARIES ${FREETYPE_LIBRARIES})
 
 foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
     if(_GTK2_component STREQUAL "gtk")
-        _GTK2_FIND_INCLUDE_DIR(GTK2_GTK gtk/gtk.h)
+        _GTK2_FIND_INCLUDE_DIR(GTK gtk/gtk.h)
         if(UNIX)
-            _GTK2_FIND_LIBRARY    (GTK2_GTK gtk-x11 false true)
+            _GTK2_FIND_LIBRARY    (GTK gtk-x11 false true)
         else()
-            _GTK2_FIND_LIBRARY    (GTK2_GTK gtk-win32 false true)
+            _GTK2_FIND_LIBRARY    (GTK gtk-win32 false true)
         endif()
-        _GTK2_ADJUST_LIB_VARS (GTK2_GTK)
+        _GTK2_ADJUST_LIB_VARS (GTK)
 
-        _GTK2_FIND_INCLUDE_DIR(GTK2_GDK gdk/gdk.h)
-        _GTK2_FIND_INCLUDE_DIR(GTK2_GDKCONFIG gdkconfig.h)
+        _GTK2_FIND_INCLUDE_DIR(GDK gdk/gdk.h)
+        _GTK2_FIND_INCLUDE_DIR(GDKCONFIG gdkconfig.h)
         if(UNIX)
-            _GTK2_FIND_LIBRARY    (GTK2_GDK gdk-x11 false true)
+            _GTK2_FIND_LIBRARY    (GDK gdk-x11 false true)
         else()
-            _GTK2_FIND_LIBRARY    (GTK2_GDK gdk-win32 false true)
+            _GTK2_FIND_LIBRARY    (GDK gdk-win32 false true)
         endif()
-        _GTK2_ADJUST_LIB_VARS (GTK2_GDK)
+        _GTK2_ADJUST_LIB_VARS (GDK)
 
-        _GTK2_FIND_INCLUDE_DIR(GTK2_CAIRO cairo.h)
-        _GTK2_FIND_LIBRARY    (GTK2_CAIRO cairo false false)
-        _GTK2_ADJUST_LIB_VARS (GTK2_CAIRO)
+        _GTK2_FIND_INCLUDE_DIR(CAIRO cairo.h)
+        _GTK2_FIND_LIBRARY    (CAIRO cairo false false)
+        _GTK2_ADJUST_LIB_VARS (CAIRO)
 
-        _GTK2_FIND_INCLUDE_DIR(GTK2_FONTCONFIG fontconfig/fontconfig.h)
+        _GTK2_FIND_INCLUDE_DIR(FONTCONFIG fontconfig/fontconfig.h)
 
-        _GTK2_FIND_INCLUDE_DIR(GTK2_PANGO pango/pango.h)
-        _GTK2_FIND_LIBRARY    (GTK2_PANGO pango false true)
-        _GTK2_ADJUST_LIB_VARS (GTK2_PANGO)
+        _GTK2_FIND_INCLUDE_DIR(PANGO pango/pango.h)
+        _GTK2_FIND_LIBRARY    (PANGO pango false true)
+        _GTK2_ADJUST_LIB_VARS (PANGO)
 
-        _GTK2_FIND_LIBRARY    (GTK2_PANGOCAIRO pangocairo false true)
-        _GTK2_ADJUST_LIB_VARS (GTK2_PANGOCAIRO)
+        _GTK2_FIND_LIBRARY    (PANGOCAIRO pangocairo false true)
+        _GTK2_ADJUST_LIB_VARS (PANGOCAIRO)
 
-        _GTK2_FIND_LIBRARY    (GTK2_PANGOFT2 pangoft2 false true)
-        _GTK2_ADJUST_LIB_VARS (GTK2_PANGOFT2)
+        _GTK2_FIND_LIBRARY    (PANGOFT2 pangoft2 false true)
+        _GTK2_ADJUST_LIB_VARS (PANGOFT2)
 
-        _GTK2_FIND_LIBRARY    (GTK2_PANGOXFT pangoxft false true)
-        _GTK2_ADJUST_LIB_VARS (GTK2_PANGOXFT)
+        _GTK2_FIND_LIBRARY    (PANGOXFT pangoxft false true)
+        _GTK2_ADJUST_LIB_VARS (PANGOXFT)
 
-        _GTK2_FIND_INCLUDE_DIR(GTK2_GDK_PIXBUF gdk-pixbuf/gdk-pixbuf.h)
-        _GTK2_FIND_LIBRARY    (GTK2_GDK_PIXBUF gdk_pixbuf false true)
-        _GTK2_ADJUST_LIB_VARS (GTK2_GDK_PIXBUF)
+        _GTK2_FIND_INCLUDE_DIR(GDK_PIXBUF gdk-pixbuf/gdk-pixbuf.h)
+        _GTK2_FIND_LIBRARY    (GDK_PIXBUF gdk_pixbuf false true)
+        _GTK2_ADJUST_LIB_VARS (GDK_PIXBUF)
 
-        _GTK2_FIND_LIBRARY    (GTK2_GTHREAD gthread false true)
-        _GTK2_ADJUST_LIB_VARS (GTK2_GTHREAD)
+        _GTK2_FIND_LIBRARY    (GTHREAD gthread false true)
+        _GTK2_ADJUST_LIB_VARS (GTHREAD)
 
-        _GTK2_FIND_LIBRARY    (GTK2_GMODULE gmodule false true)
-        _GTK2_ADJUST_LIB_VARS (GTK2_MODULE)
+        _GTK2_FIND_LIBRARY    (GMODULE gmodule false true)
+        _GTK2_ADJUST_LIB_VARS (MODULE)
 
-        _GTK2_FIND_LIBRARY    (GTK2_GIO gio false true)
-        _GTK2_ADJUST_LIB_VARS (GTK2_GIO)
+        _GTK2_FIND_LIBRARY    (GIO gio false true)
+        _GTK2_ADJUST_LIB_VARS (GIO)
 
-        _GTK2_FIND_INCLUDE_DIR(GTK2_ATK atk/atk.h)
-        _GTK2_FIND_LIBRARY    (GTK2_ATK atk false true)
-        _GTK2_ADJUST_LIB_VARS (GTK2_ATK)
+        _GTK2_FIND_INCLUDE_DIR(ATK atk/atk.h)
+        _GTK2_FIND_LIBRARY    (ATK atk false true)
+        _GTK2_ADJUST_LIB_VARS (ATK)
 
-        _GTK2_FIND_INCLUDE_DIR(GTK2_GOBJECT glib-object.h)
-        _GTK2_FIND_LIBRARY    (GTK2_GOBJECT gobject false true)
-        _GTK2_ADJUST_LIB_VARS (GTK2_GOBJECT)
+        _GTK2_FIND_INCLUDE_DIR(GOBJECT glib-object.h)
+        _GTK2_FIND_LIBRARY    (GOBJECT gobject false true)
+        _GTK2_ADJUST_LIB_VARS (GOBJECT)
 
-        _GTK2_FIND_INCLUDE_DIR(GTK2_GLIB glib.h)
-        _GTK2_FIND_INCLUDE_DIR(GTK2_GLIBCONFIG glibconfig.h)
-        _GTK2_FIND_LIBRARY    (GTK2_GLIB glib false true)
-        _GTK2_ADJUST_LIB_VARS (GTK2_GLIB)
+        _GTK2_FIND_INCLUDE_DIR(GLIB glib.h)
+        _GTK2_FIND_INCLUDE_DIR(GLIBCONFIG glibconfig.h)
+        _GTK2_FIND_LIBRARY    (GLIB glib false true)
+        _GTK2_ADJUST_LIB_VARS (GLIB)
 
-        #_GTK2_ADD_TARGET_DEPENDS(GTK2_GOBJECT glib)
-        _GTK2_ADD_TARGET_DEPENDS(GTK2_GOBJECT glib)
-        _GTK2_ADD_TARGET_DEPENDS(GTK2_ATK gobject glib)
-        _GTK2_ADD_TARGET_DEPENDS(GTK2_GIO gobject glib)
-        _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_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)
-        _GTK2_ADD_TARGET_DEPENDS(GTK2_GTK gdk atk gio pangoft2 pangocairo pango cairo gdk_pixbuf gthread gobject glib)
+        #_GTK2_ADD_TARGET_DEPENDS(GOBJECT glib)
+        _GTK2_ADD_TARGET_DEPENDS(GOBJECT glib)
+        _GTK2_ADD_TARGET_DEPENDS(ATK gobject glib)
+        _GTK2_ADD_TARGET_DEPENDS(GIO gobject glib)
+        _GTK2_ADD_TARGET_DEPENDS(GTHREAD glib)
+        _GTK2_ADD_TARGET_DEPENDS(GMODULE glib)
+        _GTK2_ADD_TARGET_DEPENDS(GDK_PIXBUF gobject glib)
+        _GTK2_ADD_TARGET_INCLUDE_DIRS(CAIRO ${FREETYPE_INCLUDE_DIRS} ${GTK2_FONTCONFIG_INCLUDE_DIRS})
+        _GTK2_ADD_TARGET_DEPENDS(PANGO gobject glib)
+        _GTK2_ADD_TARGET_DEPENDS(PANGOCAIRO pango cairo gobject glib)
+        _GTK2_ADD_TARGET_DEPENDS(GDK pangocairo pango cairo gdk_pixbuf gobject glib)
+        _GTK2_ADD_TARGET_DEPENDS(GTK gdk atk gio pangoft2 pangocairo pango cairo gdk_pixbuf gthread gobject glib)
 
     elseif(_GTK2_component STREQUAL "gtkmm")
 
-        _GTK2_FIND_INCLUDE_DIR(GTK2_GTKMM gtkmm.h)
-        _GTK2_FIND_INCLUDE_DIR(GTK2_GTKMMCONFIG gtkmmconfig.h)
-        _GTK2_FIND_LIBRARY    (GTK2_GTKMM gtkmm true true)
-        _GTK2_ADJUST_LIB_VARS (GTK2_GTKMM)
-
-        _GTK2_FIND_INCLUDE_DIR(GTK2_GDKMM gdkmm.h)
-        _GTK2_FIND_INCLUDE_DIR(GTK2_GDKMMCONFIG gdkmmconfig.h)
-        _GTK2_FIND_LIBRARY    (GTK2_GDKMM gdkmm true true)
-        _GTK2_ADJUST_LIB_VARS (GTK2_GDKMM)
-
-        _GTK2_FIND_INCLUDE_DIR(GTK2_PANGOMM pangomm.h)
-        _GTK2_FIND_INCLUDE_DIR(GTK2_PANGOMMCONFIG pangommconfig.h)
-        _GTK2_FIND_LIBRARY    (GTK2_PANGOMM pangomm true true)
-        _GTK2_ADJUST_LIB_VARS (GTK2_PANGOMM)
-
-        _GTK2_FIND_INCLUDE_DIR(GTK2_CAIROMM cairomm/cairomm.h)
-        _GTK2_FIND_INCLUDE_DIR(GTK2_CAIROMMCONFIG cairommconfig.h)
-        _GTK2_FIND_LIBRARY    (GTK2_CAIROMM cairomm true true)
-        _GTK2_ADJUST_LIB_VARS (GTK2_CAIROMM)
-
-        _GTK2_FIND_INCLUDE_DIR(GTK2_GIOMM giomm.h)
-        _GTK2_FIND_INCLUDE_DIR(GTK2_GIOMMCONFIG giommconfig.h)
-        _GTK2_FIND_LIBRARY    (GTK2_GIOMM giomm true true)
-        _GTK2_ADJUST_LIB_VARS (GTK2_GIOMM)
-
-        _GTK2_FIND_INCLUDE_DIR(GTK2_ATKMM atkmm.h)
-        _GTK2_FIND_LIBRARY    (GTK2_ATKMM atkmm true true)
-        _GTK2_ADJUST_LIB_VARS (GTK2_ATKMM)
-
-        _GTK2_FIND_INCLUDE_DIR(GTK2_GLIBMM glibmm.h)
-        _GTK2_FIND_INCLUDE_DIR(GTK2_GLIBMMCONFIG glibmmconfig.h)
-        _GTK2_FIND_LIBRARY    (GTK2_GLIBMM glibmm true true)
-        _GTK2_ADJUST_LIB_VARS (GTK2_GLIBMM)
-
-        _GTK2_FIND_INCLUDE_DIR(GTK2_SIGC++ sigc++/sigc++.h)
-        _GTK2_FIND_INCLUDE_DIR(GTK2_SIGC++CONFIG sigc++config.h)
-        _GTK2_FIND_LIBRARY    (GTK2_SIGC++ sigc true true)
-        _GTK2_ADJUST_LIB_VARS (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)
-        _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)
-        _GTK2_ADD_TARGET_INCLUDE_DIRS(GTK2_GTKMM ${FREETYPE_INCLUDE_DIRS} ${GTK2_FONTCONFIG_INCLUDE_DIRS})
+        _GTK2_FIND_INCLUDE_DIR(GTKMM gtkmm.h)
+        _GTK2_FIND_INCLUDE_DIR(GTKMMCONFIG gtkmmconfig.h)
+        _GTK2_FIND_LIBRARY    (GTKMM gtkmm true true)
+        _GTK2_ADJUST_LIB_VARS (GTKMM)
+
+        _GTK2_FIND_INCLUDE_DIR(GDKMM gdkmm.h)
+        _GTK2_FIND_INCLUDE_DIR(GDKMMCONFIG gdkmmconfig.h)
+        _GTK2_FIND_LIBRARY    (GDKMM gdkmm true true)
+        _GTK2_ADJUST_LIB_VARS (GDKMM)
+
+        _GTK2_FIND_INCLUDE_DIR(PANGOMM pangomm.h)
+        _GTK2_FIND_INCLUDE_DIR(PANGOMMCONFIG pangommconfig.h)
+        _GTK2_FIND_LIBRARY    (PANGOMM pangomm true true)
+        _GTK2_ADJUST_LIB_VARS (PANGOMM)
+
+        _GTK2_FIND_INCLUDE_DIR(CAIROMM cairomm/cairomm.h)
+        _GTK2_FIND_INCLUDE_DIR(CAIROMMCONFIG cairommconfig.h)
+        _GTK2_FIND_LIBRARY    (CAIROMM cairomm true true)
+        _GTK2_ADJUST_LIB_VARS (CAIROMM)
+
+        _GTK2_FIND_INCLUDE_DIR(GIOMM giomm.h)
+        _GTK2_FIND_INCLUDE_DIR(GIOMMCONFIG giommconfig.h)
+        _GTK2_FIND_LIBRARY    (GIOMM giomm true true)
+        _GTK2_ADJUST_LIB_VARS (GIOMM)
+
+        _GTK2_FIND_INCLUDE_DIR(ATKMM atkmm.h)
+        _GTK2_FIND_LIBRARY    (ATKMM atkmm true true)
+        _GTK2_ADJUST_LIB_VARS (ATKMM)
+
+        _GTK2_FIND_INCLUDE_DIR(GLIBMM glibmm.h)
+        _GTK2_FIND_INCLUDE_DIR(GLIBMMCONFIG glibmmconfig.h)
+        _GTK2_FIND_LIBRARY    (GLIBMM glibmm true true)
+        _GTK2_ADJUST_LIB_VARS (GLIBMM)
+
+        _GTK2_FIND_INCLUDE_DIR(SIGC++ sigc++/sigc++.h)
+        _GTK2_FIND_INCLUDE_DIR(SIGC++CONFIG sigc++config.h)
+        _GTK2_FIND_LIBRARY    (SIGC++ sigc true true)
+        _GTK2_ADJUST_LIB_VARS (SIGC++)
+
+        _GTK2_ADD_TARGET_DEPENDS(GLIBMM gobject sigc glib)
+        _GTK2_ADD_TARGET_DEPENDS(GIOMM gio glibmm gobject sigc glib)
+        _GTK2_ADD_TARGET_DEPENDS(ATKMM atk glibmm gobject sigc glib)
+        _GTK2_ADD_TARGET_DEPENDS(CAIROMM cairo sigc++)
+        _GTK2_ADD_TARGET_DEPENDS(PANGOMM glibmm cairomm pangocairo sigc++ pango cairo gobject glib)
+        _GTK2_ADD_TARGET_DEPENDS(GDKMM giomm pangomm gtk glibmm cairomm sigc++ gdk atk gio pangoft2 pangocairo gdk_pixbuf cairo pango gobject glib)
+        _GTK2_ADD_TARGET_INCLUDE_DIRS(GDKMM ${FREETYPE_INCLUDE_DIRS} ${GTK2_FONTCONFIG_INCLUDE_DIRS})
+        _GTK2_ADD_TARGET_DEPENDS(GTKMM atkmm gdkmm giomm pangomm gtk glibmm cairomm sigc++ gdk atk gio pangoft2 pangocairo gdk_pixbuf cairo pango gthread gobject glib)
+        _GTK2_ADD_TARGET_INCLUDE_DIRS(GTKMM ${FREETYPE_INCLUDE_DIRS} ${GTK2_FONTCONFIG_INCLUDE_DIRS})
 
     elseif(_GTK2_component STREQUAL "glade")
 
-        _GTK2_FIND_INCLUDE_DIR(GTK2_GLADE glade/glade.h)
-        _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)
-        _GTK2_ADD_TARGET_INCLUDE_DIRS(GTK2_GLADE ${FREETYPE_INCLUDE_DIRS} ${GTK2_FONTCONFIG_INCLUDE_DIRS})
+        _GTK2_FIND_INCLUDE_DIR(GLADE glade/glade.h)
+        _GTK2_FIND_LIBRARY    (GLADE glade false true)
+        _GTK2_ADJUST_LIB_VARS (GLADE)
+        _GTK2_ADD_TARGET_DEPENDS(GLADE gtk gdk atk gio pangoft2 pangocairo gdk_pixbuf cairo pango gobject glib)
+        _GTK2_ADD_TARGET_INCLUDE_DIRS(GLADE ${FREETYPE_INCLUDE_DIRS} ${GTK2_FONTCONFIG_INCLUDE_DIRS})
 
     elseif(_GTK2_component STREQUAL "glademm")
 
-        _GTK2_FIND_INCLUDE_DIR(GTK2_GLADEMM libglademm.h)
-        _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(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})
+        _GTK2_FIND_INCLUDE_DIR(GLADEMM libglademm.h)
+        _GTK2_FIND_INCLUDE_DIR(GLADEMMCONFIG libglademmconfig.h)
+        _GTK2_FIND_LIBRARY    (GLADEMM glademm true true)
+        _GTK2_ADJUST_LIB_VARS (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)
+        _GTK2_ADD_TARGET_INCLUDE_DIRS(GLADEMM ${FREETYPE_INCLUDE_DIRS} ${GTK2_FONTCONFIG_INCLUDE_DIRS})
 
     else()
         message(FATAL_ERROR "Unknown GTK2 component ${_component}")

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7c3adb07986c24b8081558b2cd807f30a3b7e01d
commit 7c3adb07986c24b8081558b2cd807f30a3b7e01d
Author:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
AuthorDate: Fri Aug 2 18:16:48 2013 +0200
Commit:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
CommitDate: Mon Aug 5 16:49:18 2013 +0200

    FindGTK2: Better handling of include directories
    
    Add a method _GTK2_ADD_TARGET_INCLUDE_DIRS to handle it.

diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake
index f0e5200..75fec1b 100644
--- a/Modules/FindGTK2.cmake
+++ b/Modules/FindGTK2.cmake
@@ -465,6 +465,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()
 
 #=============================================================
 
@@ -625,9 +634,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)
@@ -674,18 +681,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")
 
@@ -693,8 +697,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")
 
@@ -702,9 +705,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}")

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ab5f03d730aaa3c658bff0d3c82008da8037bc7f
commit ab5f03d730aaa3c658bff0d3c82008da8037bc7f
Author:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
AuthorDate: Mon Aug 5 10:57:18 2013 +0200
Commit:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
CommitDate: Mon Aug 5 16:49:18 2013 +0200

    FindGTK2: Create targets for each library
    
    Methods:
     * _GTK2_ADJUST_LIB_VARS
     * _GTK2_ADD_TARGET_DEPENDS_INTERNAL
     * _GTK2_ADD_TARGET_DEPENDS
    are strongly inspired by FindQt4.cmake

diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake
index a8e1ee8..f0e5200 100644
--- a/Modules/FindGTK2.cmake
+++ b/Modules/FindGTK2.cmake
@@ -78,6 +78,7 @@
 #   * Remove GTK2_SKIP_MARK_AS_ADVANCED option, as now the variables are
 #     marked as advanced by SelectLibraryConfigurations
 #   * Detect gmodule, pangoft2 and pangoxft libraries
+#   * Create targets for each library.
 # Version 1.4 (10/4/2012) (CMake 2.8.10)
 #   * 12596: Missing paths for FindGTK2 on NetBSD
 #   * 12049: Fixed detection of GTK include files in the lib folder on
@@ -383,6 +384,89 @@ function(_GTK2_FIND_LIBRARY _var _lib _expand_vc _append_version)
 endfunction()
 
 #=============================================================
+# _GTK2_ADJUST_LIB_VARS
+# Internal function to create targets for GTK2
+#   _var = target to create (GTK_ is removed)
+#=============================================================
+function(_GTK2_ADJUST_LIB_VARS _var)
+    if(GTK2_DEBUG)
+        message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}] "
+                       "_GTK2_ADJUST_LIB_VARS( ${_var} )")
+    endif()
+
+    string(REGEX REPLACE "GTK2_" "" _basename "${_var}")
+    string(TOLOWER "${_basename}" _basename)
+
+    if(${_var}_FOUND AND NOT TARGET GTK2::${_basename})
+        add_library(GTK2::${_basename} UNKNOWN IMPORTED)
+
+        if(${_var}_LIBRARY_RELEASE)
+            set_property(TARGET GTK2::${_basename} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
+            set_property(TARGET GTK2::${_basename}        PROPERTY IMPORTED_LOCATION_RELEASE "${${_var}_LIBRARY_RELEASE}" )
+        endif()
+
+        if(${_var}_LIBRARY_DEBUG)
+            set_property(TARGET GTK2::${_basename} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
+            set_property(TARGET GTK2::${_basename}        PROPERTY IMPORTED_LOCATION_DEBUG "${${_var}_LIBRARY_DEBUG}" )
+        endif()
+
+        if(${_var}_INCLUDE_DIR)
+            set_property(TARGET GTK2::${_basename} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${${_var}_INCLUDE_DIR}")
+        endif()
+
+        if(${_var}CONFIG_INCLUDE_DIR)
+            set_property(TARGET GTK2::${_basename} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${${_var}CONFIG_INCLUDE_DIR}")
+        endif()
+
+        set_property(TARGET GTK2::${_basename} PROPERTY INTERFACE_COMPILE_DEFINITIONS "${GTK2_DEFINITIONS}")
+
+        if(GTK2_USE_IMPORTED_TARGETS)
+            set(${_var}_LIBRARY GTK2::${_basename} PARENT_SCOPE)
+        endif()
+    endif()
+endfunction()
+
+function(_GTK2_ADD_TARGET_DEPENDS_INTERNAL _var _property)
+    if(GTK2_DEBUG)
+        message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}] "
+                       "_GTK2_ADD_TARGET_DEPENDS_INTERNAL( ${_var} ${_property} )")
+    endif()
+
+    string(REGEX REPLACE "GTK2_" "" _basename "${_var}")
+    string(TOLOWER "${_basename}" _basename)
+
+    if (TARGET GTK2::${_basename})
+        foreach(_depend ${ARGN})
+            set(_valid_depends)
+            if (TARGET GTK2::${_depend})
+                list(APPEND _valid_depends GTK2::${_depend})
+            endif()
+            if (_valid_depends)
+                set_property(TARGET GTK2::${_basename} APPEND PROPERTY ${_property} "${_valid_depends}")
+            endif()
+            set(_valid_depends)
+        endforeach()
+    endif()
+endfunction()
+
+function(_GTK2_ADD_TARGET_DEPENDS _var)
+    if(GTK2_DEBUG)
+        message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}] "
+                       "_GTK2_ADD_TARGET_DEPENDS( ${_var} )")
+    endif()
+
+    string(REGEX REPLACE "GTK2_" "" _basename "${_var}")
+    string(TOLOWER "${_basename}" _basename)
+
+    get_target_property(_configs GTK2::${_basename} IMPORTED_CONFIGURATIONS)
+    _GTK2_ADD_TARGET_DEPENDS_INTERNAL(${_var} INTERFACE_LINK_LIBRARIES ${ARGN})
+    foreach(_config ${_configs})
+        _GTK2_ADD_TARGET_DEPENDS_INTERNAL(${_var} IMPORTED_LINK_INTERFACE_LIBRARIES_${_config} ${ARGN})
+    endforeach()
+endfunction()
+
+
+#=============================================================
 
 #
 # main()
@@ -473,94 +557,154 @@ list(APPEND GTK2_LIBRARIES ${FREETYPE_LIBRARIES})
 foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
     if(_GTK2_component STREQUAL "gtk")
         _GTK2_FIND_INCLUDE_DIR(GTK2_GTK gtk/gtk.h)
-
         if(UNIX)
             _GTK2_FIND_LIBRARY    (GTK2_GTK gtk-x11 false true)
-            _GTK2_FIND_LIBRARY    (GTK2_GDK gdk-x11 false true)
         else()
             _GTK2_FIND_LIBRARY    (GTK2_GTK gtk-win32 false true)
-            _GTK2_FIND_LIBRARY    (GTK2_GDK gdk-win32 false true)
         endif()
+        _GTK2_ADJUST_LIB_VARS (GTK2_GTK)
 
         _GTK2_FIND_INCLUDE_DIR(GTK2_GDK gdk/gdk.h)
         _GTK2_FIND_INCLUDE_DIR(GTK2_GDKCONFIG gdkconfig.h)
+        if(UNIX)
+            _GTK2_FIND_LIBRARY    (GTK2_GDK gdk-x11 false true)
+        else()
+            _GTK2_FIND_LIBRARY    (GTK2_GDK gdk-win32 false true)
+        endif()
+        _GTK2_ADJUST_LIB_VARS (GTK2_GDK)
 
         _GTK2_FIND_INCLUDE_DIR(GTK2_CAIRO cairo.h)
         _GTK2_FIND_LIBRARY    (GTK2_CAIRO cairo false false)
+        _GTK2_ADJUST_LIB_VARS (GTK2_CAIRO)
 
         _GTK2_FIND_INCLUDE_DIR(GTK2_FONTCONFIG fontconfig/fontconfig.h)
 
         _GTK2_FIND_INCLUDE_DIR(GTK2_PANGO pango/pango.h)
         _GTK2_FIND_LIBRARY    (GTK2_PANGO pango false true)
+        _GTK2_ADJUST_LIB_VARS (GTK2_PANGO)
 
         _GTK2_FIND_LIBRARY    (GTK2_PANGOCAIRO pangocairo false true)
+        _GTK2_ADJUST_LIB_VARS (GTK2_PANGOCAIRO)
 
         _GTK2_FIND_LIBRARY    (GTK2_PANGOFT2 pangoft2 false true)
+        _GTK2_ADJUST_LIB_VARS (GTK2_PANGOFT2)
 
         _GTK2_FIND_LIBRARY    (GTK2_PANGOXFT pangoxft false true)
+        _GTK2_ADJUST_LIB_VARS (GTK2_PANGOXFT)
 
         _GTK2_FIND_INCLUDE_DIR(GTK2_GDK_PIXBUF gdk-pixbuf/gdk-pixbuf.h)
         _GTK2_FIND_LIBRARY    (GTK2_GDK_PIXBUF gdk_pixbuf false true)
+        _GTK2_ADJUST_LIB_VARS (GTK2_GDK_PIXBUF)
 
         _GTK2_FIND_LIBRARY    (GTK2_GTHREAD gthread false true)
+        _GTK2_ADJUST_LIB_VARS (GTK2_GTHREAD)
 
         _GTK2_FIND_LIBRARY    (GTK2_GMODULE gmodule false true)
+        _GTK2_ADJUST_LIB_VARS (GTK2_MODULE)
 
         _GTK2_FIND_LIBRARY    (GTK2_GIO gio false true)
+        _GTK2_ADJUST_LIB_VARS (GTK2_GIO)
 
         _GTK2_FIND_INCLUDE_DIR(GTK2_ATK atk/atk.h)
         _GTK2_FIND_LIBRARY    (GTK2_ATK atk false true)
+        _GTK2_ADJUST_LIB_VARS (GTK2_ATK)
 
         _GTK2_FIND_INCLUDE_DIR(GTK2_GOBJECT glib-object.h)
         _GTK2_FIND_LIBRARY    (GTK2_GOBJECT gobject false true)
+        _GTK2_ADJUST_LIB_VARS (GTK2_GOBJECT)
 
         _GTK2_FIND_INCLUDE_DIR(GTK2_GLIB glib.h)
         _GTK2_FIND_INCLUDE_DIR(GTK2_GLIBCONFIG glibconfig.h)
         _GTK2_FIND_LIBRARY    (GTK2_GLIB glib false true)
+        _GTK2_ADJUST_LIB_VARS (GTK2_GLIB)
+
+        #_GTK2_ADD_TARGET_DEPENDS(GTK2_GOBJECT glib)
+        _GTK2_ADD_TARGET_DEPENDS(GTK2_GOBJECT glib)
+        _GTK2_ADD_TARGET_DEPENDS(GTK2_ATK gobject glib)
+        _GTK2_ADD_TARGET_DEPENDS(GTK2_GIO gobject glib)
+        _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_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)
+        _GTK2_ADD_TARGET_DEPENDS(GTK2_GTK gdk atk gio pangoft2 pangocairo pango cairo gdk_pixbuf gthread gobject glib)
 
     elseif(_GTK2_component STREQUAL "gtkmm")
 
         _GTK2_FIND_INCLUDE_DIR(GTK2_GTKMM gtkmm.h)
         _GTK2_FIND_INCLUDE_DIR(GTK2_GTKMMCONFIG gtkmmconfig.h)
         _GTK2_FIND_LIBRARY    (GTK2_GTKMM gtkmm true true)
+        _GTK2_ADJUST_LIB_VARS (GTK2_GTKMM)
 
         _GTK2_FIND_INCLUDE_DIR(GTK2_GDKMM gdkmm.h)
         _GTK2_FIND_INCLUDE_DIR(GTK2_GDKMMCONFIG gdkmmconfig.h)
         _GTK2_FIND_LIBRARY    (GTK2_GDKMM gdkmm true true)
+        _GTK2_ADJUST_LIB_VARS (GTK2_GDKMM)
 
         _GTK2_FIND_INCLUDE_DIR(GTK2_PANGOMM pangomm.h)
         _GTK2_FIND_INCLUDE_DIR(GTK2_PANGOMMCONFIG pangommconfig.h)
         _GTK2_FIND_LIBRARY    (GTK2_PANGOMM pangomm true true)
+        _GTK2_ADJUST_LIB_VARS (GTK2_PANGOMM)
 
         _GTK2_FIND_INCLUDE_DIR(GTK2_CAIROMM cairomm/cairomm.h)
         _GTK2_FIND_INCLUDE_DIR(GTK2_CAIROMMCONFIG cairommconfig.h)
         _GTK2_FIND_LIBRARY    (GTK2_CAIROMM cairomm true true)
+        _GTK2_ADJUST_LIB_VARS (GTK2_CAIROMM)
 
         _GTK2_FIND_INCLUDE_DIR(GTK2_GIOMM giomm.h)
         _GTK2_FIND_INCLUDE_DIR(GTK2_GIOMMCONFIG giommconfig.h)
         _GTK2_FIND_LIBRARY    (GTK2_GIOMM giomm true true)
+        _GTK2_ADJUST_LIB_VARS (GTK2_GIOMM)
 
         _GTK2_FIND_INCLUDE_DIR(GTK2_ATKMM atkmm.h)
         _GTK2_FIND_LIBRARY    (GTK2_ATKMM atkmm true true)
+        _GTK2_ADJUST_LIB_VARS (GTK2_ATKMM)
 
         _GTK2_FIND_INCLUDE_DIR(GTK2_GLIBMM glibmm.h)
         _GTK2_FIND_INCLUDE_DIR(GTK2_GLIBMMCONFIG glibmmconfig.h)
         _GTK2_FIND_LIBRARY    (GTK2_GLIBMM glibmm true true)
+        _GTK2_ADJUST_LIB_VARS (GTK2_GLIBMM)
 
         _GTK2_FIND_INCLUDE_DIR(GTK2_SIGC++ sigc++/sigc++.h)
         _GTK2_FIND_INCLUDE_DIR(GTK2_SIGC++CONFIG sigc++config.h)
         _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_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}")
 
     elseif(_GTK2_component STREQUAL "glade")
 
         _GTK2_FIND_INCLUDE_DIR(GTK2_GLADE glade/glade.h)
         _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}")
 
     elseif(_GTK2_component STREQUAL "glademm")
 
         _GTK2_FIND_INCLUDE_DIR(GTK2_GLADEMM libglademm.h)
         _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}")
 
     else()
         message(FATAL_ERROR "Unknown GTK2 component ${_component}")

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eeecbe65401e4600fa9a8f3ba10abea68d1b6a9b
commit eeecbe65401e4600fa9a8f3ba10abea68d1b6a9b
Author:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
AuthorDate: Mon Aug 5 10:56:36 2013 +0200
Commit:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
CommitDate: Mon Aug 5 16:49:18 2013 +0200

    FindGTK2: Search for glib-object.h instead of gobject/gobject.h
    
    This is the topmost include file for GObject header files

diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake
index 08dbe48..a8e1ee8 100644
--- a/Modules/FindGTK2.cmake
+++ b/Modules/FindGTK2.cmake
@@ -511,7 +511,7 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
         _GTK2_FIND_INCLUDE_DIR(GTK2_ATK atk/atk.h)
         _GTK2_FIND_LIBRARY    (GTK2_ATK atk false true)
 
-        _GTK2_FIND_INCLUDE_DIR(GTK2_GOBJECT gobject/gobject.h)
+        _GTK2_FIND_INCLUDE_DIR(GTK2_GOBJECT glib-object.h)
         _GTK2_FIND_LIBRARY    (GTK2_GOBJECT gobject false true)
 
         _GTK2_FIND_INCLUDE_DIR(GTK2_GLIB glib.h)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ed14da39c51bc6cc6efc1551e0c55679798fde5f
commit ed14da39c51bc6cc6efc1551e0c55679798fde5f
Author:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
AuthorDate: Fri Aug 2 17:39:28 2013 +0200
Commit:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
CommitDate: Mon Aug 5 16:49:18 2013 +0200

    FindGTK2: Populate GTK2_DEFINITIONS before searching for libraries

diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake
index 3c828f4..08dbe48 100644
--- a/Modules/FindGTK2.cmake
+++ b/Modules/FindGTK2.cmake
@@ -449,6 +449,20 @@ if(GTK2_FIND_VERSION)
 endif()
 
 #
+# On MSVC, according to https://wiki.gnome.org/gtkmm/MSWindows, the /vd2 flag needs to be
+# passed to the compiler in order to use gtkmm
+#
+if(MSVC)
+    foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
+        if(_GTK2_component STREQUAL "gtkmm")
+            set(GTK2_DEFINITIONS "/vd2")
+        elseif(_GTK2_component STREQUAL "glademm")
+            set(GTK2_DEFINITIONS "/vd2")
+        endif()
+    endforeach()
+endif()
+
+#
 # Find all components
 #
 
@@ -565,20 +579,6 @@ if(NOT GTK2_FIND_VERSION AND GTK2_GTK_INCLUDE_DIR)
 endif()
 
 #
-# On MSVC, according to https://wiki.gnome.org/gtkmm/MSWindows, the /vd2 flag needs to be
-# passed to the compiler in order to use gtkmm
-#
-if(MSVC)
-    foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
-        if(_GTK2_component STREQUAL "gtkmm")
-            set(GTK2_DEFINITIONS "/vd2")
-        elseif(_GTK2_component STREQUAL "glademm")
-            set(GTK2_DEFINITIONS "/vd2")
-        endif()
-    endforeach()
-endif()
-
-#
 # Try to enforce components
 #
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fc3b60dfbb4b9525662b3301ecb547d025e04ee8
commit fc3b60dfbb4b9525662b3301ecb547d025e04ee8
Author:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
AuthorDate: Fri Aug 2 17:36:21 2013 +0200
Commit:     Daniele E. Domenichelli <daniele.domenichelli at iit.it>
CommitDate: Mon Aug 5 16:49:18 2013 +0200

    FindGTK2: Export GTK2_XXX_FOUND to parent scope in _GTK2_FIND_LIBRARY
    
    Also add a debug message to report if the library was found or not

diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake
index 77aac6d..3c828f4 100644
--- a/Modules/FindGTK2.cmake
+++ b/Modules/FindGTK2.cmake
@@ -364,6 +364,7 @@ function(_GTK2_FIND_LIBRARY _var _lib _expand_vc _append_version)
     select_library_configurations(${_var})
 
     set(${_var}_LIBRARY ${${_var}_LIBRARY} PARENT_SCOPE)
+    set(${_var}_FOUND ${${_var}_FOUND} PARENT_SCOPE)
 
     set(GTK2_LIBRARIES ${GTK2_LIBRARIES} ${${_var}_LIBRARY})
     set(GTK2_LIBRARIES ${GTK2_LIBRARIES} PARENT_SCOPE)
@@ -375,6 +376,8 @@ function(_GTK2_FIND_LIBRARY _var _lib _expand_vc _append_version)
                        "${_var}_LIBRARY_DEBUG   = \"${${_var}_LIBRARY_DEBUG}\"")
         message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}]     "
                        "${_var}_LIBRARY         = \"${${_var}_LIBRARY}\"")
+        message(STATUS "[FindGTK2.cmake:${CMAKE_CURRENT_LIST_LINE}]     "
+                       "${_var}_FOUND           = \"${${_var}_FOUND}\"")
     endif()
 
 endfunction()

-----------------------------------------------------------------------

Summary of changes:
 Modules/FindGTK2.cmake         |  332 +++++++++++++++++++++++++++++-----------
 Tests/CMakeLists.txt           |   30 ++++
 Tests/GTK2Gtk/CMakeLists.txt   |   10 ++
 Tests/GTK2Gtk/main.c           |   15 ++
 Tests/GTK2GtkMM/CMakeLists.txt |   10 ++
 Tests/GTK2GtkMM/helloworld.cpp |   29 ++++
 Tests/GTK2GtkMM/helloworld.h   |   20 +++
 Tests/GTK2GtkMM/main.cpp       |   13 ++
 8 files changed, 368 insertions(+), 91 deletions(-)
 create mode 100644 Tests/GTK2Gtk/CMakeLists.txt
 create mode 100644 Tests/GTK2Gtk/main.c
 create mode 100644 Tests/GTK2GtkMM/CMakeLists.txt
 create mode 100644 Tests/GTK2GtkMM/helloworld.cpp
 create mode 100644 Tests/GTK2GtkMM/helloworld.h
 create mode 100644 Tests/GTK2GtkMM/main.cpp


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list