Add CMake infrastructure

This commit is contained in:
2013-05-17 18:26:08 +02:00
parent 156e12c456
commit 9c024a57cd
5 changed files with 133 additions and 44 deletions

View File

@@ -37,6 +37,7 @@
#include <errno.h>
#include <signal.h>
#include "config.h"
#include "stardict.h"
@@ -849,8 +850,12 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
g_type_init ();
G_GNUC_END_IGNORE_DEPRECATIONS
static GOptionEntry entries[] =
gboolean show_version = FALSE;
GOptionEntry entries[] =
{
{ "version", 0, G_OPTION_FLAG_IN_MAIN,
G_OPTION_ARG_NONE, &show_version,
"Output version information and exit", NULL },
{ NULL }
};
@@ -868,6 +873,12 @@ G_GNUC_END_IGNORE_DEPRECATIONS
exit (EXIT_FAILURE);
}
if (show_version)
{
g_print (PROJECT_NAME " " PROJECT_VERSION "\n");
exit (EXIT_SUCCESS);
}
if (argc != 2)
{
gchar *help = g_option_context_get_help (ctx, TRUE, FALSE);