[glibmm] Only compile the properties example if properties are enabled.



commit 4a7e27629523826d36565bff459c323573b87668
Author: David King <davidk openismus com>
Date:   Fri Jul 17 17:36:04 2009 +0200

    Only compile the properties example if properties are enabled.

 ChangeLog                                 |    5 +++++
 examples/properties/properties_example.cc |    5 +++++
 2 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index d756d9c..5631a40 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-17  David King  <davidk openismus com>
+
+	* examples/properties/properties_example.cc: Only compile the
+	properties example if properties are enabled.
+
 2009-07-16  Jonathon Jongsma  <jonathon jongsma collabora co uk>
 
 	* .gitignore:
diff --git a/examples/properties/properties_example.cc b/examples/properties/properties_example.cc
index 82ad4ae..0f7578b 100644
--- a/examples/properties/properties_example.cc
+++ b/examples/properties/properties_example.cc
@@ -18,6 +18,8 @@
 #include <glibmm.h>
 #include <iostream>
 
+// This example will not work without properties support
+#ifdef GLIBMM_PROPERTIES_ENABLED
 // A class that contains properties must inherit from Glib::Object (or a class
 // that inherits from Glib::Object)
 class Person : public Glib::Object
@@ -56,9 +58,11 @@ void on_lastname_changed ()
 { std::cout << "- lastname changed!" << std::endl; }
 void on_age_changed ()
 { std::cout << "- age changed!" << std::endl; }
+#endif // GLIBMM_PROPERTIES_ENABLED
 
 int main(int, char**)
 {
+#ifdef GLIBMM_PROPERTIES_ENABLED
     Glib::init ();
     Person p;
     // Register some handlers that will be called when the values of the
@@ -78,4 +82,5 @@ int main(int, char**)
     std::cout << "Done changing the properties of 'p'" << std::endl;
 
     return 0;
+#endif // GLIBMM_PROPERTIES_ENABLED
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]