Skip to content

Commit

Permalink
Added version info to cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
phw committed Jan 7, 2016
1 parent c1e905f commit a9f548c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ Makefile
peek
src/*.c
ui/*.c
ui/about.ui
schemas/gschemas.compiled
15 changes: 12 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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)
4 changes: 2 additions & 2 deletions ui/about.ui → ui/about.ui.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.19.0
<!-- Generated with glade 3.19.0
Copyright (C) Philipp Wolfer <[email protected]>
Expand Down Expand Up @@ -33,7 +33,7 @@ Author: Philipp Wolfer <[email protected]>
<property name="window_position">center-on-parent</property>
<property name="type_hint">normal</property>
<property name="program_name">Peek</property>
<property name="version">0.1</property>
<property name="version">@PEEK_VERSION_MAJOR@.@PEEK_VERSION_MINOR@.@PEEK_VERSION_PATCH@</property>
<property name="comments" translatable="yes">Animated GIF recorder</property>
<property name="website">https://github.com/phw/peek</property>
<property name="authors">Philipp Wolfer</property>
Expand Down

0 comments on commit a9f548c

Please sign in to comment.