Skip to content
Permalink
Browse files

Get rid of svn version stuff from release branch.

  • Loading branch information
timlinux committed Jul 5, 2011
1 parent 92df029 commit e355a607bad6cadbd43f1b947baf36f63cecefec
Showing with 30 additions and 54 deletions.
  1. +25 −46 CMakeLists.txt
  2. +2 −2 src/app/main.cpp
  3. +1 −1 src/app/qgisapp.cpp
  4. +2 −5 src/core/qgis.cpp
@@ -439,64 +439,43 @@ INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/src/core ${CMAKE_BINARY_DIR}/src/gui)

#############################################################
# create qgssvnversion.h
# create qgsversion.h

FIND_FILE(SVN_MARKER entries PATHS ${CMAKE_SOURCE_DIR}/.svn)
FIND_FILE(GIT_MARKER index PATHS ${CMAKE_SOURCE_DIR}/.git)

IF (SVN_MARKER)
# See if we have svn installed
FIND_PROGRAM(SVNVERSION svnversion PATHS c:/cygwin/bin)
FIND_FILE(GIT_MARKER index PATHS ${CMAKE_SOURCE_DIR}/.git)

IF(SVNVERSION)
IF (GIT_MARKER)
FIND_PROGRAM(GIT git PATHS c:/cygwin/bin)
IF(GIT)
IF(MSVC)
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h
COMMAND for /f usebackq %%a in "(`\"${SVNVERSION}\"`)" do echo \#define QGSSVNVERSION \"%%a\" >${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h
MAIN_DEPENDENCY ${SVN_MARKER}
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h
COMMAND for /f \"usebackq tokens=1\" %%a in "(`\"${GIT}\" log -n1 --oneline`)" do echo \#define QGSVERSION \"%%a\" >${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h
MAIN_DEPENDENCY ${GIT_MARKER}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
ELSE(MSVC)
MESSAGE(STATUS "writing ${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h")
EXECUTE_PROCESS(COMMAND ${GIT} log -n1 --pretty=%h OUTPUT_VARIABLE REVISION)
STRING(STRIP "${REVISION}" REVISION)
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h
COMMAND echo \\\#define QGSSVNVERSION \\\"`${SVNVERSION}`\\\" >${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h
MAIN_DEPENDENCY ${SVN_MARKER}
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h
COMMAND echo \\\#define QGSVERSION \\\"${REVISION}\\\" >${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h
MAIN_DEPENDENCY ${GIT_MARKER}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
ENDIF(MSVC)
ELSE(SVNVERSION)
MESSAGE(STATUS "svnversion not found - version will be unknown")
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h "#define QGSSVNVERSION \"unknown\"")
ENDIF (SVNVERSION)
ELSE (SVN_MARKER)
IF (GIT_MARKER)
FIND_PROGRAM(GIT git PATHS c:/cygwin/bin)
IF(GIT)
IF(MSVC)
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h
COMMAND for /f \"usebackq tokens=1\" %%a in "(`\"${GIT}\" log -n1 --oneline`)" do echo \#define QGSSVNVERSION \"%%a\" >${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h
MAIN_DEPENDENCY ${GIT_MARKER}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
ELSE(MSVC)
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h
COMMAND echo \\#define QGSSVNVERSION \\\"$$\( ${GIT} log -n1 --pretty=%h \)\\\" >${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h
MAIN_DEPENDENCY ${GIT_MARKER}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
ENDIF(MSVC)
ELSE(GIT)
MESSAGE(STATUS "git marker, but no git found - version will be unknown")
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h "#define QGSSVNVERSION \"unknown\"")
ENDIF(GIT)
ELSE (GIT_MARKER)
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h "#define QGSSVNVERSION \"exported\"")
ENDIF (GIT_MARKER)
ENDIF (SVN_MARKER)

ADD_CUSTOM_TARGET(svnversion ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h)
ELSE(GIT)
MESSAGE(STATUS "git marker, but no git found - version will be unknown")
SET(REVISION "unknown")
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h "#define QGSVERSION \"unknown\"")
ENDIF(GIT)
ELSE (GIT_MARKER)
SET(REVISION "exported")
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h "#define QGSVERSION \"exported\"")
ENDIF (GIT_MARKER)

ADD_CUSTOM_TARGET(version ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/qgsversion.h)

#############################################################
# process subdirs
@@ -67,7 +67,7 @@ typedef SInt32 SRefCon;
#include "qgsmapcanvas.h"
#include "qgsapplication.h"
#include <qgsconfig.h>
#include <qgssvnversion.h>
#include <qgsversion.h>
#include "qgsexception.h"
#include "qgsproject.h"
#include "qgsrectangle.h"
@@ -86,7 +86,7 @@ static const char * const ident_ = "$Id$";
void usage( std::string const & appName )
{
std::cerr << "Quantum GIS - " << VERSION << " '" << RELEASE_NAME << "' ("
<< QGSSVNVERSION << ")\n"
<< QGis::QGIS_DEV_VERSION << ")\n"
<< "Quantum GIS (QGIS) is a viewer for spatial data sets, including\n"
<< "raster and vector data.\n"
<< "Usage: " << appName << " [options] [FILES]\n"
@@ -1916,7 +1916,7 @@ void QgisApp::about()
abt = new QgsAbout();
QString versionString = tr( "You are using QGIS version %1 built against code revision %2." )
.arg( QGis::QGIS_VERSION )
.arg( QGis::QGIS_SVN_VERSION );
.arg( QGis::QGIS_DEV_VERSION );

versionString += tr( "\nGDAL/OGR Version: %1." ).arg( GDAL_RELEASE_NAME );

@@ -16,8 +16,8 @@
* *
***************************************************************************/
#include "qgis.h"
#ifndef QGSSVNVERSION
#include "qgssvnversion.h"
#ifndef QGSVERSION
#include "qgsversion.h"
#endif

#include "qgsconfig.h"
@@ -28,9 +28,6 @@
// Version string
const char* QGis::QGIS_VERSION = VERSION;

// SVN version
const char* QGis::QGIS_SVN_VERSION = QGSSVNVERSION;

// Version number used for comparing versions using the
// "Check QGIS Version" function
const int QGis::QGIS_VERSION_INT = VERSION_INT;

0 comments on commit e355a60

Please sign in to comment.
You can’t perform that action at this time.