]> git.sesse.net Git - kdenlive/commitdiff
Add svn revision to Kdenlive version at build time
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Fri, 13 Mar 2009 10:31:38 +0000 (10:31 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Fri, 13 Mar 2009 10:31:38 +0000 (10:31 +0000)
svn path=/trunk/kdenlive/; revision=3148

CMakeLists.txt
kdenlive-config.h.cmake [new file with mode: 0644]
src/main.cpp

index 995fb8014c02cc1573b53b6e34ffd7bf098d7ced..59d347d79fc71d289d232cc8e5dff338dd7c40d2 100644 (file)
@@ -1,6 +1,8 @@
 project(kdenlive)
 
+SET(BASE_VERSION 0.7.2)
 
+OPTION(RELEASE_BUILD "Remove compilation date to version, use for stable releases (default off)" OFF)
 set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules )
 
 # search packages used by KDE
@@ -22,7 +24,25 @@ find_program(MSGFMT_EXECUTABLE msgfmt)
 find_program(MSGMERGE_EXECUTABLE msgmerge)
 find_program(XGETTEXT_EXECUTABLE xgettext)
 
-
+# current version
+IF (RELEASE_BUILD)
+    SET(VERSION "\"${BASE_VERSION}\"")
+ELSE(RELEASE_BUILD)
+   IF (EXISTS ${PROJECT_SOURCE_DIR}/.svn) 
+      # Probably a SVN workspace, determine revision level 
+      FIND_PACKAGE(Subversion) 
+      IF(Subversion_FOUND) 
+        Subversion_WC_INFO(${PROJECT_SOURCE_DIR} KDENLIVE) 
+        MESSAGE("Current revision is ${KDENLIVE_WC_REVISION}") 
+       SET(VERSION "\"${BASE_VERSION} (rev. ${KDENLIVE_WC_REVISION})\"")
+      ELSE(Subversion_FOUND)
+       MESSAGE("Could not determine SVN revision")
+       SET(VERSION "\"${BASE_VERSION}\"")
+      ENDIF(Subversion_FOUND) 
+    ELSE(EXISTS ${PROJECT_SOURCE_DIR}/.svn)
+    SET(VERSION "\"${BASE_VERSION}\"")
+    ENDIF(EXISTS ${PROJECT_SOURCE_DIR}/.svn)
+ENDIF(RELEASE_BUILD)
 
 add_subdirectory(src src/cmake_bindir)
 add_subdirectory(renderer renderer/cmake_bindir)
@@ -36,4 +56,5 @@ add_subdirectory(lumas)
 add_subdirectory(po)
 add_subdirectory(man)
 
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/kdenlive-config.h.cmake kdenlive-config.h @ONLY)
 
diff --git a/kdenlive-config.h.cmake b/kdenlive-config.h.cmake
new file mode 100644 (file)
index 0000000..2f43f50
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef CONFIG_H
+#define CONFIG_H
+
+#cmakedefine VERSION @VERSION@
+
+#endif
+
index 4f2ce1bc2d0ad565b9c3d83942b078da51585b0e..525a3c3d76e09d0cc93f6d001aecc785c5372527 100644 (file)
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
  ***************************************************************************/
 
+#include "kdenlive-config.h"
+#include "mainwindow.h"
+
 #include <KApplication>
 #include <KAboutData>
 #include <KDebug>
 #include <KCmdLineArgs>
 #include <KUrl> //new
 
-#include "mainwindow.h"
 
 #if defined(__APPLE_KDE__) || defined(__DARWIN__)
 #include <SDL/SDL.h>
 #endif
 
+static const char version[] = VERSION;
+
 int main(int argc, char *argv[]) {
     KAboutData aboutData(QByteArray("kdenlive"), QByteArray("kdenlive"),
-                         ki18n("Kdenlive"), QByteArray("0.7.2"),
+                         ki18n("Kdenlive"), QByteArray(version),
                          ki18n("An open source video editor."),
                          KAboutData::License_GPL,
                          ki18n("Copyright (c) 2008 Development team"));