From ba309bf38b0d0485d4bfddabde411c11dc876b07 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 1 Mar 2016 19:44:32 +0000 Subject: [PATCH] Refactored the make tag-test, tag-run, branch-test, branch-run and ChangeLog features of the CMakeLists build system so it now supports working off git instead of subversion --- CMakeLists.txt | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 551969961..0b3d5901a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,7 +57,7 @@ SET(OPENSCENEGRAPH_PATCH_VERSION 0) SET(OPENSCENEGRAPH_SOVERSION 130) # set to 0 when not a release candidate, non zero means that any generated -# svn tags will be treated as release candidates of given number +# git tags will be treated as release candidates of given number SET(OPENSCENEGRAPH_RELEASE_CANDIDATE 0) SET(OPENSCENEGRAPH_VERSION ${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}) @@ -119,22 +119,13 @@ IF (OSG_MAINTAINER) #SET(OPENSCENEGRAPH_SVN "trunk") SET(OPENSCENEGRAPH_SVN "branches") + SET(OPENSCENEGRAPH_BRANCH OpenSceneGraph-${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}) # # Provide target for tagging a release # - SET(SVNCOMMAND svn) - SET(SVNTRUNKDIR http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk) - SET(SVNTAGDIR http://svn.openscenegraph.org/osg/OpenSceneGraph/tags) - SET(SVNBRANCHDIR http://svn.openscenegraph.org/osg/OpenSceneGraph/branches) - - IF (OPENSCENEGRAPH_SVN STREQUAL "trunk") - SET(SVNSOURCEDIR ${SVNTRUNKDIR}) - ELSE() - SET(SVNSOURCEDIR ${SVNBRANCHDIR}/${OPENSCENEGRAPH_BRANCH}) - ENDIF() - + SET(GITCOMMAND git) IF (OPENSCENEGRAPH_RELEASE_CANDIDATE EQUAL 0) SET(RELEASE_NAME OpenSceneGraph-${OPENSCENEGRAPH_VERSION}) @@ -144,29 +135,33 @@ IF (OSG_MAINTAINER) ADD_CUSTOM_TARGET(tag-test - COMMAND echo ${SVNCOMMAND} copy ${SVNSOURCEDIR} ${SVNTAGDIR}/${RELEASE_NAME} -m "Release ${RELEASE_NAME}" + COMMAND echo ${GITCOMMAND} tag -a ${RELEASE_NAME} -m \\\"Release ${RELEASE_NAME}\\\" + COMMAND echo ${GITCOMMAND} push origin ${RELEASE_NAME} ) ADD_CUSTOM_TARGET(tag-run - COMMAND ${SVNCOMMAND} copy ${SVNSOURCEDIR} ${SVNTAGDIR}/${RELEASE_NAME} -m "Release ${RELEASE_NAME}" + COMMAND ${GITCOMMAND} tag -a ${RELEASE_NAME} -m \\\"Release ${RELEASE_NAME}\\\" + COMMAND ${GITCOMMAND} push origin ${RELEASE_NAME} ) ADD_CUSTOM_TARGET(branch-test - COMMAND echo ${SVNCOMMAND} copy ${SVNSOURCEDIR} ${SVNBRANCHDIR}/${OPENSCENEGRAPH_BRANCH} -m "Branch ${OPENSCENEGRAPH_BRANCH}" + COMMAND echo ${GITCOMMAND} branch ${OPENSCENEGRAPH_BRANCH} -m \\\"Branch ${OPENSCENEGRAPH_BRANCH}\\\" + COMMAND echo ${GITCOMMAND} push origin ${OPENSCENEGRAPH_BRANCH} ) ADD_CUSTOM_TARGET(branch-run - COMMAND ${SVNCOMMAND} copy ${SVNSOURCEDIR} ${SVNBRANCHDIR}/${OPENSCENEGRAPH_BRANCH} -m "Branch ${OPENSCENEGRAPH_BRANCH}" + COMMAND ${GITCOMMAND} branch ${OPENSCENEGRAPH_BRANCH} -m \\\"Branch ${OPENSCENEGRAPH_BRANCH}\\\" + COMMAND ${GITCOMMAND} push origin ${OPENSCENEGRAPH_BRANCH} ) # # Provide target for generating ChangeLog # - SET(GENERATELOGS svn2cl) + SET(GITLOGFORMAT "%aD%nChecked in by : %an%n%s%b%n") + SET(GENERATELOGS git log --pretty=format:${GITLOGFORMAT}) ADD_CUSTOM_TARGET(ChangeLog - COMMAND ${SVNCOMMAND} update - COMMAND ${GENERATELOGS} ${SVNSOURCEDIR} + COMMAND ${GENERATELOGS} > ChangeLog ) ENDIF(OSG_MAINTAINER)