Commit c1dac252 authored by Stepan Salenikovich's avatar Stepan Salenikovich
Browse files

gnome: add version to cmake

Refs #69346

Change-Id: I320654316e296bc4be640a8266d22b5ba8c57f7f
parent 3bc50a80
...@@ -13,7 +13,21 @@ ENDIF() ...@@ -13,7 +13,21 @@ ENDIF()
ADD_DEFINITIONS("-std=c++1y") ADD_DEFINITIONS("-std=c++1y")
# set project name and version
PROJECT(ring-client-gnome) PROJECT(ring-client-gnome)
SET(PROJECT_VERSION_MAJOR 0)
SET(PROJECT_VERSION_MINOR 1)
SET(PROJECT_VERSION_PATCH 0)
# create config header file to pass cmake settings to source code
CONFIGURE_FILE (
"${PROJECT_SOURCE_DIR}/src/config.h.in"
"${PROJECT_BINARY_DIR}/config.h"
)
# add the binary tree to the search path for include files
# so that we will find config.h
INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
......
/* cmake will generate config.h with defines containing the values defined in cmake */
#define VERSION_MAJOR @PROJECT_VERSION_MAJOR@
#define VERSION_MINOR @PROJECT_VERSION_MINOR@
#define VERSION_PATCH @PROJECT_VERSION_PATCH@
\ No newline at end of file
...@@ -30,10 +30,7 @@ ...@@ -30,10 +30,7 @@
#include "ring_client_options.h" #include "ring_client_options.h"
/* TODO: add header for auto generated config #include "config.h"
* #include "config.h"
*/
#include <glib/gi18n.h> #include <glib/gi18n.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -45,7 +42,7 @@ option_version_cb(G_GNUC_UNUSED const gchar *option_name, ...@@ -45,7 +42,7 @@ option_version_cb(G_GNUC_UNUSED const gchar *option_name,
G_GNUC_UNUSED GError **error) G_GNUC_UNUSED GError **error)
{ {
/* TODO: replace with auto generated version */ /* TODO: replace with auto generated version */
g_print("%s\n", "0.1"); g_print("%d.%d.%d\n", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH);
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment