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

List:       kde-commits
Subject:    [kdenlive/next] /: Rename VERSION #define to KDENLIVE_VERSION
From:       Vincent PINON <vincent.pinon () laposte ! net>
Date:       2014-04-30 20:27:53
Message-ID: E1Wfb6f-0003AX-L8 () scm ! kde ! org
[Download RAW message or body]

Git commit 959155fa6dcd3d4c8143aed22a29110cd4e555ea by Vincent PINON, on behalf of Alberto Villa.
Committed on 09/06/2013 at 10:44.
Pushed by vpinon into branch 'next'.

Rename VERSION #define to KDENLIVE_VERSION

Conflicts:
	src/mainwindow.cpp

Conflicts:
	src/mainwindow.cpp

M  +22   -24   CMakeLists.txt
M  +1    -1    config-kdenlive.h.cmake
M  +1    -1    src/kdenlivedoc.cpp
M  +1    -1    src/main.cpp
M  +1    -8    src/mainwindow.cpp
M  +1    -1    src/wizard.cpp

http://commits.kde.org/kdenlive/959155fa6dcd3d4c8143aed22a29110cd4e555ea

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 442ee68..0b56ca8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,33 +15,31 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
 option(RELEASE_BUILD "Remove Git revision from program version (use for stable releases)" OFF)
 
 # Get current version.
-set(VERSION "\"${KDENLIVE_VERSION}\"")
-if(NOT RELEASE_BUILD)
-  if(EXISTS ${PROJECT_SOURCE_DIR}/.git)
-    # Probably a Git workspace: determine the revision.
-    find_package(Git)
-    if(GIT_FOUND)
+set(KDENLIVE_VERSION_STRING "${KDENLIVE_VERSION}")
+if(NOT RELEASE_BUILD AND EXISTS ${CMAKE_SOURCE_DIR}/.git)
+  # Probably a Git workspace; determine the revision.
+  find_package(Git QUIET)
+  if(GIT_FOUND)
+    exec_program(${GIT_EXECUTABLE}
+      ${CMAKE_SOURCE_DIR}
+      ARGS "describe --tags"
+      OUTPUT_VARIABLE KDENLIVE_GIT_REVISION
+      RETURN_VALUE TAG_RESULT
+    )
+    # git describe --tags failed; maybe the repository was checked with depth=1.
+    if(NOT ${TAG_RESULT} EQUAL 0)
       exec_program(${GIT_EXECUTABLE}
-        ${CMAKE_CURRENT_SOURCE_DIR}
-        ARGS "describe --tags"
+        ${CMAKE_SOURCE_DIR}
+        ARGS "describe --always"
         OUTPUT_VARIABLE KDENLIVE_GIT_REVISION
-        RETURN_VALUE TAG_RESULT
       )
-      # git describe --tags failed, for example it fails if repo was checked with depth=1
-      if(NOT ${TAG_RESULT} EQUAL 0)
-        exec_program(${GIT_EXECUTABLE}
-          ${CMAKE_CURRENT_SOURCE_DIR}
-          ARGS "describe --always"
-          OUTPUT_VARIABLE KDENLIVE_GIT_REVISION
-        )
-      endif(NOT ${TAG_RESULT} EQUAL 0)
-      message("Current Kdenlive Git revision is ${KDENLIVE_GIT_REVISION}")
-      set(VERSION "\"${KDENLIVE_VERSION} (rev. ${KDENLIVE_GIT_REVISION})\"")
-    else(GIT_FOUND)
-      message("Could not determine the Git revision")
-    endif(GIT_FOUND)
-  endif(EXISTS ${PROJECT_SOURCE_DIR}/.git)
-endif(NOT RELEASE_BUILD)
+    endif()
+    message(STATUS "Kdenlive Git revision: ${KDENLIVE_GIT_REVISION}")
+    set(KDENLIVE_VERSION_STRING "${KDENLIVE_VERSION} (rev. ${KDENLIVE_GIT_REVISION})")
+  else()
+    message(STATUS "Kdenlive Git revision could not be determined")
+  endif()
+endif()
 
 include(CheckIncludeFiles)
 check_include_files(malloc.h HAVE_MALLOC_H)
diff --git a/config-kdenlive.h.cmake b/config-kdenlive.h.cmake
index ab1563f..fdb9f83 100644
--- a/config-kdenlive.h.cmake
+++ b/config-kdenlive.h.cmake
@@ -1,7 +1,7 @@
 #ifndef CONFIG_H
 #define CONFIG_H
 
-#cmakedefine VERSION @VERSION@
+#define KDENLIVE_VERSION "@KDENLIVE_VERSION_STRING@"
 
 #define MLT_PREFIX "@MLT_PREFIX@"
 
diff --git a/src/kdenlivedoc.cpp b/src/kdenlivedoc.cpp
index 14611b4..f7b6650 100644
--- a/src/kdenlivedoc.cpp
+++ b/src/kdenlivedoc.cpp
@@ -687,7 +687,7 @@ QDomDocument KdenliveDoc::xmlSceneList(const QString &scene, const QStringList &
 
     QDomElement markers = sceneList.createElement("markers");
     addedXml.setAttribute("version", DOCUMENTVERSION);
-    addedXml.setAttribute("kdenliveversion", VERSION);
+    addedXml.setAttribute("kdenliveversion", KDENLIVE_VERSION);
     addedXml.setAttribute("profile", profilePath());
     addedXml.setAttribute("projectfolder", m_projectFolder.path());
 
diff --git a/src/main.cpp b/src/main.cpp
index 54dfd83..288babe 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -31,7 +31,7 @@
 int main(int argc, char *argv[])
 {
     KAboutData aboutData(QByteArray("kdenlive"), QByteArray("kdenlive"),
-                         ki18n("Kdenlive"), VERSION,
+                         ki18n("Kdenlive"), KDENLIVE_VERSION,
                          ki18n("An open source video editor."),
                          KAboutData::License_GPL,
                          ki18n("Copyright  © 2007–2014 Kdenlive authors"));
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 41b5a10..913f4a8 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -118,14 +118,7 @@
 #include <stdlib.h>
 #include <locale.h>
 
-// Uncomment for deeper debugging
-//#define DEBUG_MAINW
-
-#ifdef DEBUG_MAINW
-#include <QDebug>
-#endif
-
-static const char version[] = VERSION;
+static const char version[] = KDENLIVE_VERSION;
 
 namespace Mlt
 {
diff --git a/src/wizard.cpp b/src/wizard.cpp
index 47de0a0..25698ae 100644
--- a/src/wizard.cpp
+++ b/src/wizard.cpp
@@ -51,7 +51,7 @@ const int mltVersionMajor = 0;
 const int mltVersionMinor = 8;
 const int mltVersionRevision = 8;
 
-static const char kdenlive_version[] = VERSION;
+static const char kdenlive_version[] = KDENLIVE_VERSION;
 
 Wizard::Wizard(bool upgrade, QWidget *parent) :
     QWizard(parent),

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

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