From a9f548c80507c267c4b964dff588b1d0623d5697 Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Thu, 7 Jan 2016 12:04:44 +0100 Subject: [PATCH] Added version info to cmake --- .gitignore | 1 + CMakeLists.txt | 15 ++++++++++++--- ui/{about.ui => about.ui.in} | 4 ++-- 3 files changed, 15 insertions(+), 5 deletions(-) rename ui/{about.ui => about.ui.in} (95%) diff --git a/.gitignore b/.gitignore index fb23f800..6b84d69c 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ Makefile peek src/*.c ui/*.c +ui/about.ui schemas/gschemas.compiled diff --git a/CMakeLists.txt b/CMakeLists.txt index 493ee539..30a0342c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,10 @@ project("peek" C) cmake_minimum_required(VERSION 2.6) +set (PEEK_VERSION_MAJOR 0) +set (PEEK_VERSION_MINOR 1) +set (PEEK_VERSION_PATCH 0) + set (XDG_APPS_INSTALL_DIR share/applications) set (GettextTranslate_GMO_BINARY TRUE) set (GettextTranslate_ALL TRUE) @@ -31,13 +35,18 @@ pkg_check_modules(CAIRO REQUIRED cairo) pkg_check_modules(GMODULE REQUIRED gmodule-2.0) # compile glib resource files to c code +configure_file ( + "${PROJECT_SOURCE_DIR}/ui/about.ui.in" + "${PROJECT_SOURCE_DIR}/ui/about.ui" + ) + GLIB_COMPILE_RESOURCES(GLIB_RESOURCES SOURCE ui/${PROJECT_NAME}.gresource.xml ) # GSettings -add_schema (schemas/de.uploadedlobster.peek.gschema.xml) +add_schema(schemas/de.uploadedlobster.peek.gschema.xml) # Compile Vala to C vala_precompile(VALA_C @@ -62,8 +71,8 @@ add_definitions(-DGETTEXT_PACKAGE="${GETTEXT_PACKAGE}") add_executable(${PROJECT_NAME} ${VALA_C} ${GLIB_RESOURCES}) # Installation -install (TARGETS ${PROJECT_NAME} DESTINATION bin) -install (PROGRAMS peek.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}) +install(TARGETS ${PROJECT_NAME} DESTINATION bin) +install(PROGRAMS peek.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}) add_subdirectory(assets) add_subdirectory(po) diff --git a/ui/about.ui b/ui/about.ui.in similarity index 95% rename from ui/about.ui rename to ui/about.ui.in index ea09a017..0d3a5184 100644 --- a/ui/about.ui +++ b/ui/about.ui.in @@ -1,5 +1,5 @@ -