[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [Amarok]  Work towards putting the version in the app when c
From:       Jeff Mitchell <mitchell () kde ! org>
Date:       2009-11-03 23:48:25
Message-ID: 200911032348.nA3NmP7f029581 () Wurst ! kollide ! net
[Download RAW message or body]

commit 6e6a56e46e4935fb16f115cfa33de2ea5d54120f
Author:     Jeff Mitchell <mitchell@kde.org>
AuthorDate: Tue Nov 3 18:41:37 2009 -0500
Commit:     Jeff Mitchell <mitchell@kde.org>
CommitDate: Tue Nov 3 18:42:24 2009 -0500

    Work towards putting the version in the app when compiling from git. ki18n may \
kill this though as it wants to do version processing.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 12f8723..763d561 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -43,6 +43,11 @@ include(CheckTagLibFileName)
 
 check_taglib_filename(COMPLEX_TAGLIB_FILENAME)
 
+execute_process( COMMAND "git" "describe" WORKING_DIRECTORY \
${CMAKE_CURRENT_SOURCE_DIR} RESULT_VARIABLE GIT_OUTPUT_VALUE OUTPUT_VARIABLE \
CURRENT_GIT_VERSION ) +if(GIT_OUTPUT_VALUE EQUAL 0)
+    message(STATUS "Building git version ${CURRENT_GIT_VERSION}")
+endif(GIT_OUTPUT_VALUE EQUAL 0)
+
 configure_file(config-amarok.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-amarok.h )
 
 # Needed to conditionally build tests and gui
diff --git a/config-amarok.h.cmake b/config-amarok.h.cmake
index 36d452d..4250b3a 100644
--- a/config-amarok.h.cmake
+++ b/config-amarok.h.cmake
@@ -1,4 +1,4 @@
-/* config.h. Generated by cmake from config.h.cmake */
+/* config-amarok.h. Generated by cmake from config-amarok.h.cmake */
 
 /* The size of a `int', as computed by sizeof. */
 #define SIZEOF_INT ${SIZEOF_INT}
@@ -32,3 +32,6 @@
 
 /* Whether TagLib::FileName is a struct supporting wide characters or just a typedef \
*/  #cmakedefine COMPLEX_TAGLIB_FILENAME 1
+
+/* The Git version being compiled, if any. undef means not running from Git. */
+#cmakedefine CURRENT_GIT_VERSION ${CURRENT_GIT_VERSION}
diff --git a/src/Amarok.h b/src/Amarok.h
index 87329b6..964ee36 100644
--- a/src/Amarok.h
+++ b/src/Amarok.h
@@ -258,6 +258,10 @@ namespace Amarok
 
 
 /// Update this when necessary
+//#ifdef CURRENT_GIT_VERSION
+//#define APP_VERSION #CURRENT_GIT_VERSION
+//#else
 #define APP_VERSION "2.2-GIT"
+//#endif
 
 #endif


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic