From 80441884571e1122babe6bd433ec221e007fc814 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 1 Sep 2008 15:27:35 +0000 Subject: [PATCH] Introduced a OSG_MAINTAINER section of cmake build to help support making tags and branches --- CMakeLists.txt | 72 +++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 62 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 322eea194..6cc59f19f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,10 @@ SET(OPENSCENEGRAPH_MINOR_VERSION 7) SET(OPENSCENEGRAPH_PATCH_VERSION 2) SET(OPENSCENEGRAPH_SOVERSION 46) +# 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 +SET(OPENSCENEGRAPH_RELEASE_CANDIDATE 0) + SET(OPENSCENEGRAPH_VERSION ${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}) SET(OSG_PLUGINS osgPlugins-${OPENSCENEGRAPH_VERSION}) @@ -81,6 +85,64 @@ IF(CMAKE_SYSTEM MATCHES IRIX) SET(CMAKE_THREAD_LIBS_INIT "" CACHE INTERNAL "") ENDIF(CMAKE_SYSTEM MATCHES IRIX) +OPTION(OSG_MAINTAINER "Enable OpenSceneGraph maintainer build methods, such as making svn branches, tags, updating ChangeLog." OFF) +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://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk) + SET(SVNTAGDIR http://www.openscenegraph.org/svn/osg/OpenSceneGraph/tags) + SET(SVNBRANCHDIR http://www.openscenegraph.org/svn/osg/OpenSceneGraph/branch) + + IF (OPENSCENEGRAPH_SVN STREQUAL "trunk") + SET(SVNSOURCEDIR ${SVNTRUNKDIR}) + ELSE (OPENSCENEGRAPH_SVN STREQUAL "trunk") + SET(SVNSOURCEDIR ${SVNBRANCH_DIR}/${OPENSCENEGRAPH_BRANCH}) + ENDIF(OPENSCENEGRAPH_SVN STREQUAL "trunk") + + + IF (OPENSCENEGRAPH_RELEASE_CANDIDATE EQUAL 0) + SET(RELEASE_NAME OpenSceneGraph-${OPENSCENEGRAPH_VERSION}) + ELSE (OPENSCENEGRAPH_RELEASE_CANDIDATE EQUAL 0) + SET(RELEASE_NAME OpenSceneGraph-${OPENSCENEGRAPH_VERSION}-rc${OPENSCENEGRAPH_RELEASE_CANDIDATE}) + ENDIF(OPENSCENEGRAPH_RELEASE_CANDIDATE EQUAL 0) + + + ADD_CUSTOM_TARGET(tag-test + COMMAND echo ${SVNCOMMAND} copy ${SVNSOURCEDIR} ${SVNTAGDIR}/${RELEASE_NAME} -m "Release ${RELEASE_NAME}" + ) + + ADD_CUSTOM_TARGET(tag-run + COMMAND ${SVNCOMMAND} copy ${SVNSOURCEDIR} ${SVNTAGDIR}/${RELEASE_NAME} -m "Release ${RELEASE_NAME}" + ) + + ADD_CUSTOM_TARGET(branch-test + COMMAND echo ${SVNCOMMAND} copy ${SVNSOURCEDIR} ${SVNBRANCHDIR}/${OPENSCENEGRAPH_BRANCH} -m "Branch ${OPENSCENEGRAPH_BRANCH}" + ) + + ADD_CUSTOM_TARGET(branch-run + COMMAND ${SVNCOMMAND} copy ${SVNSOURCEDIR} ${SVNBRANCHDIR}/${OPENSCENEGRAPH_BRANCH} -m "Branch ${OPENSCENEGRAPH_BRANCH}" + ) + + # + # Provide target for generating ChangeLog + # + SET(SVN2LOG ~/bin/svn2log.py) + SET(GENERATELOGS svn log -v --xml | python ${SVN2LOG} -L -H) + + ADD_CUSTOM_TARGET(ChangeLog + COMMAND ${GENERATELOGS} + ) + +ENDIF(OSG_MAINTAINER) + + # Find OpenGL FIND_PACKAGE(OpenGL) @@ -575,16 +637,6 @@ ADD_CUSTOM_TARGET(wrappers ) -# -# Provide target for generating ChangeLog -# -SET(SVN2LOG ~/bin/svn2log.py) -SET(GENERATELOGS svn log -v --xml | python ${SVN2LOG} -L -H) - -ADD_CUSTOM_TARGET(ChangeLog - COMMAND ${GENERATELOGS} -) - OPTION(BUILD_REF_DOCS "Build OpenSceneGraph reference documentation using doxygen (use: make DoxygenDoc)" OFF) IF(BUILD_REF_DOCS)