grim/guifications3

removed gflib-genheader and replaced it with a cmake configure file
--- a/gflib/gflib.pc.in Mon May 16 20:43:54 2011 -0500
+++ b/gflib/gflib.pc.in Mon May 16 20:46:27 2011 -0500
@@ -6,8 +6,6 @@
plugin_dir=${libdir}/guifications
-gflib_genheader=${bindir}/gflib-genheader
-
Name: libgflib
Description: Guifications library
Version: @VERSION@
--- a/gflib/gflib/CMakeLists.txt Mon May 16 20:43:54 2011 -0500
+++ b/gflib/gflib/CMakeLists.txt Mon May 16 20:46:27 2011 -0500
@@ -85,21 +85,14 @@
)
###############################################################################
-# gflib-genheader executable
-###############################################################################
-add_executable(gflib-genheader gf_genheader.c)
-target_link_libraries(gflib-genheader ${GLIB_LIBRARIES})
-
-###############################################################################
# gf_lib.h generation
###############################################################################
-add_custom_command(
- OUTPUT gf_lib.h
- DEPENDS gflib-genheader ${GFLIB_HEADERS} ${GFLIB_BUILT_HEADERS}
- COMMAND gflib-genheader -s GF_LIB_H -d gflib
- ${GFLIB_HEADERS} ${GFLIB_BUILT_HEADERS} >
- ${CMAKE_CURRENT_BINARY_DIR}/gf_lib.h
-)
+set(GFLIB_H_INCLUDES "")
+foreach(HEADER ${GFLIB_HEADERS} ${GFLIB_BUILT_HEADERS})
+ set(GFLIB_H_INCLUDES "${GFLIB_H_INCLUDES}\n#include <gflib/${HEADER}>")
+endforeach(HEADER)
+
+configure_file(gf_lib.h.in gf_lib.h @ONLY)
###############################################################################
# gflib-query-plugins executable
@@ -176,7 +169,7 @@
install(TARGETS gflib LIBRARY DESTINATION lib)
# install gflib-query-plugins and gflib-genheader
-install(TARGETS gflib-query-plugins gflib-genheader RUNTIME DESTINATION bin)
+install(TARGETS gflib-query-plugins RUNTIME DESTINATION bin)
# install the single include into the main directory
install(
--- a/gflib/gflib/gf_genheader.c Mon May 16 20:43:54 2011 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +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/>.
- */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif /* HAVE_CONFIG_H */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <glib.h>
-
-static const gchar *gpl =
- "/*\n"
- " * %s\n"
- " * %s\n"
- " *\n"
- " * Guifications - The end-all, be-all notification framework\n"
- " * Copyright (C) 2003-2009 Gary Kramlich <grim@reaperworld.com>\n"
- " *\n"
- " * This program is free software: you can redistribute it and/or modify\n"
- " * it under the terms of the GNU General Public License as published by\n"
- " * the Free Software Foundation, either version 3 of the License, or\n"
- " * (at your option) any later version.\n"
- " *\n"
- " * This program is distributed in the hope that it will be useful,\n"
- " * but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
- " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
- " * GNU General Public License for more details.\n"
- " *\n"
- " * You should have received a copy of the GNU General Public License\n"
- " * along with this program. If not, see <http://www.gnu.org/licenses/>.\n"
- " */\n";
-
-/* static globals for GOption */
-static gchar *copyright = "Copyright (C) 2003-2009 Gary Kramich <grim@reaperworldcom>";
-static gchar *directory = NULL;
-static gchar *symbol = "GF__H";
-static gchar *tagline = "Guifications - The end-all, be-all notification framework";
-static gchar *license = "gpl";
-
-static GOptionEntry entries[] = {
- {
- "copyright", 'c', 0, G_OPTION_ARG_STRING, &copyright,
- "The copyright for the generated file.",
- "copyright",
- }, {
- "directory", 'd', 0, G_OPTION_ARG_STRING, &directory,
- "The directory to use in the #include.",
- "directory",
- }, {
- "license", 'l', 0, G_OPTION_ARG_STRING, &license,
- "The license to use.",
- "license",
- }, {
- "symbol", 's', 0, G_OPTION_ARG_STRING, &symbol,
- "The symbol to \"protect\" the header file.",
- "symbol",
- }, {
- "tagline", 't', 0, G_OPTION_ARG_STRING, &tagline,
- "The tagline to use.",
- "tagline",
- }, {
- NULL
- },
-};
-
-gint
-main(gint argc, gchar **argv) {
- GError *error = NULL;
- GOptionContext *ctx = NULL;
- gchar *slash = NULL;
- gint i;
-
- ctx = g_option_context_new("FILES");
- g_option_context_add_main_entries(ctx, entries, GETTEXT_PACKAGE);
- g_option_context_parse(ctx, &argc, &argv, &error);
-
- if(error) {
- fprintf(stderr, "%s", error->message);
- g_error_free(error);
- return 1;
- }
-
- printf(gpl, tagline, copyright);
- printf("#ifndef %s\n#define %s\n\n", symbol, symbol);
-
- if(!directory)
- directory = slash = "";
- else
- slash = "/";
-
- for(i = 1; argv[i]; i++)
- printf("#include <%s%s%s>\n", directory, slash, argv[i]);
-
- printf("\n#endif /* %s */\n", symbol);
-
- return 0;
-}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gflib/gflib/gf_lib.h.in Mon May 16 20:46:27 2011 -0500
@@ -0,0 +1,27 @@
+/*
+ * Guifications - The end-all, be-all notification framework
+ * Copyright (C) 2003-2011 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_LIB_H
+#define GF_LIB_H
+
+#define GFLIB_H_INSIDE
+@GFLIB_H_INCLUDES@
+
+#undef GFLIB_H_INSIDE
+
+#endif /* GF_LIB_H */
+