summaryrefslogtreecommitdiffstats
path: root/CMake/Modules/FindSigC++.cmake
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-05-27 23:26:19 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2013-01-09 17:12:15 +0100
commit0b339e547b77f80d6e81313bfb38249ce8995553 (patch)
treef22fee0142f72042430ace070a6e6ef4493e7c39 /CMake/Modules/FindSigC++.cmake
parent16074a7c2c8197a061281a6880ddbc3967d8ea0c (diff)
downloadmanaserv-0b339e547b77f80d6e81313bfb38249ce8995553.tar.gz
manaserv-0b339e547b77f80d6e81313bfb38249ce8995553.tar.xz
manaserv-0b339e547b77f80d6e81313bfb38249ce8995553.zip
Replaced EventListener with signals based on libsigc++
This replaces the rather hard to understand event dispatcher with a probably even harder to understand templated library, but fortunately we can rely on the available documentation. Hopefully it will also help with the readability of our code and with adding additional signals to other classes. Added libsigc++ to README and Travis CI configuration. Reviewed-by: Erik Schilling
Diffstat (limited to 'CMake/Modules/FindSigC++.cmake')
-rw-r--r--CMake/Modules/FindSigC++.cmake34
1 files changed, 34 insertions, 0 deletions
diff --git a/CMake/Modules/FindSigC++.cmake b/CMake/Modules/FindSigC++.cmake
new file mode 100644
index 0000000..35687d5
--- /dev/null
+++ b/CMake/Modules/FindSigC++.cmake
@@ -0,0 +1,34 @@
+# - Try to find SigC++-2.0
+# Once done, this will define
+#
+# SigC++_FOUND - system has SigC++
+# SigC++_INCLUDE_DIRS - the SigC++ include directories
+# SigC++_LIBRARIES - link these to use SigC++
+
+include(LibFindMacros)
+
+# Use pkg-config to get hints about paths
+libfind_pkg_check_modules(SigC++_PKGCONF sigc++-2.0)
+
+# Main include dir
+find_path(SigC++_INCLUDE_DIR
+ NAMES sigc++/sigc++.h
+ PATHS ${SigC++_PKGCONF_INCLUDE_DIRS}
+ PATH_SUFFIXES sigc++-2.0
+)
+
+# Glib-related libraries also use a separate config header, which is in lib dir
+find_path(SigC++Config_INCLUDE_DIR
+ NAMES sigc++config.h
+ PATHS ${SigC++_PKGCONF_INCLUDE_DIRS} /usr
+ PATH_SUFFIXES lib/sigc++-2.0/include
+)
+
+libfind_library(SigC++ sigc 2.0)
+
+# Set the include dir variables and the libraries and let libfind_process do
+# the rest. NOTE: Singular variables for this library, plural for libraries
+# this this lib depends on.
+set(SigC++_PROCESS_INCLUDES SigC++_INCLUDE_DIR SigC++Config_INCLUDE_DIR)
+set(SigC++_PROCESS_LIBS SigC++_LIBRARY)
+libfind_process(SigC++)