Skip to content
Permalink
Browse files

improve qgssvnversion.h creation

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11451 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Aug 20, 2009
1 parent 3bd3e06 commit a42e27f8defc9127806b89a9071bc32f977af9e3
@@ -340,20 +340,33 @@ LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/src/core ${CMAKE_BINARY_DIR}/src/gui)

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

IF (NOT SVN_MARKER)
SET (SVN_MARKER ${CMAKE_SOURCE_DIR}/CMakeLists.txt) # Dummy file
ENDIF (NOT SVN_MARKER)
# Add a custom command to drive the svn script whenever the svn entries
# file changes.
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake_templates/svnscript.cmake.in_cmake
${CMAKE_CURRENT_BINARY_DIR}/svnscript.cmake
@ONLY)

ADD_CUSTOM_COMMAND (
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h
DEPENDS ${SVN_MARKER}
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/svnscript.cmake
)
IF (SVN_MARKER)
# See if we have svn installed
FIND_PROGRAM(SVNVERSION svnversion PATHS c:/cygwin/bin)

IF(SVNVERSION)
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}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
ELSE(MSVC)
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}
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)
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h "#define QGSSVNVERSION \"exported\"")
ENDIF (SVN_MARKER)

ADD_CUSTOM_TARGET(svnversion ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h)

This file was deleted.

This file was deleted.

@@ -1,5 +1,6 @@
@echo off
set GRASS_VERSION=6.4.0svn
set SVNVERSION=c:/cygwin/bin/svnversion

set BUILDDIR=%CD%\build
REM set BUILDDIR=%TEMP%\qgis_unstable
@@ -99,6 +100,8 @@ cmake -G "Visual Studio 9 2008" ^
-D QT_ZLIB_LIBRARY=%O4W_ROOT%/lib/zlib.lib ^
-D QT_PNG_LIBRARY=%O4W_ROOT%/lib/libpng13.lib ^
-D CMAKE_INSTALL_PREFIX=%O4W_ROOT%/apps/qgis-dev ^
-D CMAKE_CXX_FLAGS_RELWITHDEBINFO="/MD /ZI /Od /D NDEBUG" ^
-D SVNVERSION="%SVNVERSION%" ^
%SRCDIR%>>%LOG% 2>&1
if errorlevel 1 goto error

0 comments on commit a42e27f

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