From: Jean-Baptiste Mardelle Date: Fri, 13 Mar 2009 10:31:38 +0000 (+0000) Subject: Add svn revision to Kdenlive version at build time X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=806e12388f8667cbb15b0c8e6eb0b49539c52b73;hp=26cf46e4addc75c5869c73fa97b5832f9c8037f5;p=kdenlive Add svn revision to Kdenlive version at build time svn path=/trunk/kdenlive/; revision=3148 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 995fb801..59d347d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 index 00000000..2f43f50c --- /dev/null +++ b/kdenlive-config.h.cmake @@ -0,0 +1,7 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#cmakedefine VERSION @VERSION@ + +#endif + diff --git a/src/main.cpp b/src/main.cpp index 4f2ce1bc..525a3c3d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -18,21 +18,25 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ +#include "kdenlive-config.h" +#include "mainwindow.h" + #include #include #include #include #include //new -#include "mainwindow.h" #if defined(__APPLE_KDE__) || defined(__DARWIN__) #include #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"));