grim/guifications3

moved guifications-gtk to cmake
cmake
2010-12-13, Gary Kramlich
36e02fafe588
Parents 6bb904bfdb5d
Children 422e30c70e86
moved guifications-gtk to cmake
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/guifications-gtk/CMakeLists.txt Mon Dec 13 22:32:05 2010 -0600
@@ -0,0 +1,75 @@
+cmake_minimum_required(VERSION 2.8)
+
+###############################################################################
+# Project Info
+###############################################################################
+project(guifications-gtk C)
+
+set(GUIFICATIONS_GTK_MAJOR_VERSION 0)
+set(GUIFICATIONS_GTK_MINOR_VERSION 0)
+set(GUIFICATIONS_GTK_MICRO_VERSION 1)
+set(GUIFICATIONS_GTK_EXTRA_VERSION dev)
+
+set(VERSION ${GUIFICATIONS_GTK_MAJOR_VERSION}.${GUIFICATIONS_GTK_MINOR_VERSION}.${GUIFICATIONS_GTK_MICRO_VERSION}${GUIFICATIONS_GTK_EXTRA_VERSION})
+
+###############################################################################
+# Dependencies
+###############################################################################
+include(FindPkgConfig)
+
+pkg_check_modules(GLIB REQUIRED
+ glib-2.0>=2.16.0
+ gobject-2.0>=2.16.0
+ gthread-2.0>=2.16.0
+)
+
+pkg_check_modules(GTK REQUIRED gtk+-2.0>=2.16.0)
+
+pkg_check_modules(GFLIB REQUIRED gflib)
+
+pkg_check_modules(GFLIB_UI REQUIRED gflib-ui)
+
+pkg_check_modules(GFLIB_GTK REQUIRED gflib-gtk)
+
+###############################################################################
+# Build Info
+###############################################################################
+include_directories(
+ ${CMAKE_SOURCE_DIR}
+ ${GLIB_INCLUDE_DIRS}
+ ${GTK_INCLUDE_DIRS}
+ ${GFLIB_INCLUDE_DIRS}
+ ${GFLIB_UI_INCLUDE_DIRS}
+ ${GFLIB_GTK_INCLUDE_DIRS}
+)
+
+link_directories(
+ ${GLIB_LIBRARY_DIRS}
+ ${GTK_LIBRARY_DIRS}
+ ${GFLIB_LIBRARY_DIRS}
+ ${GFLIB_UI_LIBRARY_DIRS}
+ ${GFLIB_GTK_LIBRARY_DIRS}
+)
+
+add_definitions(
+ -DGETTEXT_PACKAGE="guifications-gtk"
+ -DDATADIR="${CMAKE_INSTALL_PREFIX}/share"
+ -DLOCALEDIR="${CMAKE_INSTALL_PREFIX}/locale"
+ -g -g3 -Wall
+)
+
+###############################################################################
+# Subdirectories
+###############################################################################
+add_subdirectory(src)
+add_subdirectory(pixmaps)
+
+###############################################################################
+# Install Stuff
+###############################################################################
+# documentation
+install(
+ FILES AUTHORS ChangeLog COPYING NEWS README
+ DESTINATION share/doc/guifications-gtk
+)
+
--- a/guifications-gtk/Makefile.am Mon Dec 13 22:19:44 2010 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-SUBDIRS = pixmaps po src
-
-DISTCLEANFILES=
-
-EXTRA_DIST = \
- AUTHORS \
- NEWS \
- INSTALL \
- COPYING \
- README \
- ChangeLog \
- configure.ac
-
-$(OBJECTS): libtool
-libtool: $(LIBTOOL_DEPS)
- $(SHELL) ./config.status --recheck
--- a/guifications-gtk/autogen.sh Mon Dec 13 22:19:44 2010 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-#!/bin/sh
-# Guifications - The end-all, be-all notification framework
-# Copyright (C) 2003-2009 Gary Kramlich <grim@reaperworld.com>
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-PACKAGE="guifications-gtk"
-
-which gflib-autogen.sh || {
- echo "You need to install gflib to run autogen"
- exit 1
-}
-
-. gflib-autogen.sh
-
-add_default_commands
-
-autogen
-
--- a/guifications-gtk/configure.ac Mon Dec 13 22:19:44 2010 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-dnl Process this file with autoconf to create configure.
-
-dnl ################################################################
-dnl # Initialize autoconf
-dnl ################################################################
-AC_INIT(guifications-gtk, 0.0.1dev, guifications-devel@lists.guifications.org)
-AC_PREREQ(2.50)
-AC_CANONICAL_SYSTEM
-AC_CONFIG_SRCDIR(config.h.in)
-AC_COPYRIGHT([Copyright 2003-2009 Gary Kramlich])
-
-dnl ################################################################
-dnl # Initialize automake
-dnl ################################################################
-AM_INIT_AUTOMAKE([gnu dist-bzip2])
-
-dnl ################################################################
-dnl # Configuration file
-dnl ################################################################
-AM_CONFIG_HEADER(config.h)
-
-dnl # Stash configure args
-AC_DEFINE_UNQUOTED(CONFIG_ARGS, "$ac_configure_args", [configure arguments])
-
-# set our language to C
-AC_LANG([C])
-
-dnl #######################################################################
-dnl # Make sure we have pkg-config
-dnl #######################################################################
-PKG_PROG_PKG_CONFIG
-
-dnl #######################################################################
-dnl # Setup libtool
-dnl #######################################################################
-LT_INIT
-LT_LANG([C])
-LIBTOOL="$LIBTOOL --silent"
-
-dnl #######################################################################
-dnl # I'm lazy and figured config.h is the best place for this ;)
-dnl #######################################################################
-AC_DEFINE_UNQUOTED(GFLIB_WEBSITE, "http://guifications.org/", [gflib website])
-
-dnl #######################################################################
-dnl # Our header
-dnl #######################################################################
-AH_TOP([ /* our header */
-#ifndef CONFIG_H
-#define CONFIG_H
-])
-AH_BOTTOM([
-#endif /* CONFIG_H */
-])
-
-dnl #######################################################################
-dnl # INTLTOOL
-dnl #######################################################################
-AC_PROG_INTLTOOL
-
-GETTEXT_PACKAGE=guifications-gtk
-AC_SUBST(GETTEXT_PACKAGE)
-AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], [Define the gettext package to be used])
-
-ALL_LINGUAS=""
-AM_GLIB_GNU_GETTEXT
-
-dnl #######################################################################
-dnl # Look for the C compiler
-dnl #######################################################################
-CFLAGS_save="$CFLAGS"
-AC_PROG_CC
-CFLAGS="$CFLAGS_save"
-
-AC_ARG_ENABLE(debug,
- AC_HELP_STRING([--enable-debug],[compile with debugging support])
- ,,enable_debug=no)
-
-if test x"$enable_debug" = x"yes" ; then
- AC_DEFINE(DEBUG, 1, [Define if debugging is enabled.])
-fi
-
-if test x"$GCC" = x"yes"; then
- CFLAGS="$CFLAGS -Wall -g3"
-fi
-AC_SUBST(CFLAGS)
-
-dnl #######################################################################
-dnl # check for gflib
-dnl #######################################################################
-PKG_CHECK_MODULES(GFLIB, gflib)
-AC_SUBST(GFLIB_CFLAGS)
-AC_SUBST(GFLIB_LIBS)
-
-AC_MSG_CHECKING([loch ness monster])
-AC_MSG_RESULT([yes, er, wait, no...])
-
-PKG_CHECK_MODULES(GFLIB_GTK, gflib-gtk)
-AC_SUBST(GFLIB_GTK_CFLAGS)
-AC_SUBST(GFLIB_GTK_LIBS)
-
-dnl #######################################################################
-dnl # check for glib and other glib dependencies
-dnl #######################################################################
-PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.12.0 gobject-2.0 >= 2.12.0])
-AC_SUBST(GLIB_CFLAGS)
-AC_SUBST(GLIB_LIBS)
-
-PKG_CHECK_MODULES(GTK, gtk+-2.0)
-AC_SUBST(GTK_CFLAGS)
-AC_SUBST(GTK_LIBS)
-
-dnl #######################################################################
-dnl # Finish up
-dnl #######################################################################
-AC_OUTPUT([Makefile
- pixmaps/Makefile
- po/Makefile.in
- src/Makefile
- ])
-
-dnl #######################################################################
-dnl # Ouput!!
-dnl #######################################################################
-
-echo;
-echo AC_PACKAGE_NAME AC_PACKAGE_VERSION Configuration complete
-echo;
-echo Debugging enabled................: $enable_debug
-echo;
-echo Type make to compile
-echo;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/guifications-gtk/pixmaps/CMakeLists.txt Mon Dec 13 22:32:05 2010 -0600
@@ -0,0 +1,11 @@
+set(PIXMAPS
+ tray_icon.png
+)
+
+foreach(PIXMAP ${PIXMAPS})
+ install(
+ FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PIXMAP}
+ DESTINATION share/guifications-gtk
+ )
+endforeach(PIXMAP)
+
--- a/guifications-gtk/pixmaps/Makefile.am Mon Dec 13 22:19:44 2010 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-EXTRA_DIST=\
- tray_icon.png
-
-pixmapdir=$(datadir)/pixmaps/guifications/gtk
-pixmap_DATA=tray_icon.png
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/guifications-gtk/src/CMakeLists.txt Mon Dec 13 22:32:05 2010 -0600
@@ -0,0 +1,35 @@
+###############################################################################
+# guifications-gtk target
+###############################################################################
+set(GUIFICATIONS_GTK_HEADERS
+ gf_gtk_feeds.h
+ gf_gtk_icon.h
+ gf_gtk_prefs.h
+ guifications-gtk.h
+)
+
+set(GUIFICATIONS_GTK_SOURCES
+ gf_gtk_feeds.c
+ gf_gtk_icon.c
+ gf_gtk_prefs.c
+ guifications-gtk.c
+)
+
+add_executable(guifications-gtk
+ ${GUIFICATIONS_GTK_HEADERS}
+ ${GUIFICATIONS_GTK_SOURCES}
+)
+
+target_link_libraries(guifications-gtk
+ ${GLIB_LIBRARIES}
+ ${GTK_LIBRARIES}
+ ${GFLIB_LIBRARIES}
+ ${GFLIB_UI_LIBRARIES}
+ ${GFLIB_GTK_LIBRARIES}
+)
+
+###############################################################################
+# Install Stuff
+###############################################################################
+install(TARGETS guifications-gtk RUNTIME DESTINATION bin)
+
--- a/guifications-gtk/src/gf_gtk_feeds.h Mon Dec 13 22:19:44 2010 -0600
+++ b/guifications-gtk/src/gf_gtk_feeds.h Mon Dec 13 22:32:05 2010 -0600
@@ -18,8 +18,8 @@
#ifndef GF_GTK_FEEDS_H
#define GF_GTK_FEEDS_H
-#include <gflib/gf_lib.h>
-#include <gflib-gtk/gf_lib_gtk.h>
+#include <gf_lib.h>
+#include <gf_lib_gtk.h>
G_BEGIN_DECLS
--- a/guifications-gtk/src/gf_gtk_icon.h Mon Dec 13 22:19:44 2010 -0600
+++ b/guifications-gtk/src/gf_gtk_icon.h Mon Dec 13 22:32:05 2010 -0600
@@ -18,7 +18,7 @@
#ifndef GF_GTK_ICON_H
#define GF_GTK_ICON_H
-#include <gflib-gtk/gf_lib_gtk.h>
+#include <gf_lib_gtk.h>
G_BEGIN_DECLS
--- a/guifications-gtk/src/gf_gtk_intl.h Mon Dec 13 22:19:44 2010 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
- * Guifications - The end-all, be-all notification framework
- * Copyright (C) 2003-2009 Gary Kramlich <grim@reaperworld.com>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-#ifndef GF_GTK_INTL_H
-#define GF_GTK_INTL_H
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#ifdef ENABLE_NLS
-# include <locale.h>
-# include <libintl.h>
-# define _(x) dgettext(PACKAGE, x)
-# ifdef dgettext_noop
-# define N_(String) dgettext_noop (PACKAGE, String)
-# else
-# define N_(String) (String)
-# endif
-#else
-# include <locale.h>
-# define N_(String) (String)
-# define _(x) (x)
-# define ngettext(Singular, Plural, Number) ((Number == 1) ? (Singular) : (Plural))
-#endif /* ENABLE_NLS */
-
-#endif /* GF_GTK_INTL_H */
--- a/guifications-gtk/src/gf_gtk_prefs.h Mon Dec 13 22:19:44 2010 -0600
+++ b/guifications-gtk/src/gf_gtk_prefs.h Mon Dec 13 22:32:05 2010 -0600
@@ -18,8 +18,8 @@
#ifndef GF_GTK_PREFS_H
#define GF_GTK_PREFS_H
-#include <gflib/gf_lib.h>
-#include <gflib-gtk/gf_lib_gtk.h>
+#include <gf_lib.h>
+#include <gf_lib_gtk.h>
G_BEGIN_DECLS
--- a/guifications-gtk/src/guifications-gtk.h Mon Dec 13 22:19:44 2010 -0600
+++ b/guifications-gtk/src/guifications-gtk.h Mon Dec 13 22:32:05 2010 -0600
@@ -18,8 +18,8 @@
#ifndef GF_GTK_H
#define GF_GTK_H
-#include <gflib/gf_lib.h>
-#include <gflib-gtk/gf_lib_gtk.h>
+#include <gf_lib.h>
+#include <gf_lib_gtk.h>
G_BEGIN_DECLS
@@ -28,3 +28,4 @@
G_END_DECLS
#endif /* GF_GTK_H */
+