Add CMake infrastructure
This commit is contained in:
13
src/sdtui.c
13
src/sdtui.c
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user