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

This commit is contained in:
Robert Osfield 2016-03-01 19:44:32 +00:00
parent 60a7b8ce02
commit ba309bf38b

View File

@ -57,7 +57,7 @@ SET(OPENSCENEGRAPH_PATCH_VERSION 0)
SET(OPENSCENEGRAPH_SOVERSION 130) SET(OPENSCENEGRAPH_SOVERSION 130)
# set to 0 when not a release candidate, non zero means that any generated # 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_RELEASE_CANDIDATE 0)
SET(OPENSCENEGRAPH_VERSION ${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}) 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 "trunk")
SET(OPENSCENEGRAPH_SVN "branches") SET(OPENSCENEGRAPH_SVN "branches")
SET(OPENSCENEGRAPH_BRANCH OpenSceneGraph-${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}) SET(OPENSCENEGRAPH_BRANCH OpenSceneGraph-${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION})
# #
# Provide target for tagging a release # Provide target for tagging a release
# #
SET(SVNCOMMAND svn) SET(GITCOMMAND git)
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()
IF (OPENSCENEGRAPH_RELEASE_CANDIDATE EQUAL 0) IF (OPENSCENEGRAPH_RELEASE_CANDIDATE EQUAL 0)
SET(RELEASE_NAME OpenSceneGraph-${OPENSCENEGRAPH_VERSION}) SET(RELEASE_NAME OpenSceneGraph-${OPENSCENEGRAPH_VERSION})
@ -144,29 +135,33 @@ IF (OSG_MAINTAINER)
ADD_CUSTOM_TARGET(tag-test 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 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 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 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 # 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 ADD_CUSTOM_TARGET(ChangeLog
COMMAND ${SVNCOMMAND} update COMMAND ${GENERATELOGS} > ChangeLog
COMMAND ${GENERATELOGS} ${SVNSOURCEDIR}
) )
ENDIF(OSG_MAINTAINER) ENDIF(OSG_MAINTAINER)