From 42d331b3957104e776e91f38ee7ccb20f7ebcd1e Mon Sep 17 00:00:00 2001 From: Ken Martin Date: Thu, 30 Jun 2005 13:09:07 -0400 Subject: [PATCH] ENH: better release scripts --- Utilities/Release/CMake.nsi.in | 2 +- Utilities/Release/MakeRelease.cmake.in | 42 ++++++++++++++++++++++++++ Utilities/Release/Release.cmake | 16 +++++++--- Utilities/Release/Win32Release.sh.in | 30 ------------------ 4 files changed, 55 insertions(+), 35 deletions(-) create mode 100644 Utilities/Release/MakeRelease.cmake.in delete mode 100755 Utilities/Release/Win32Release.sh.in diff --git a/Utilities/Release/CMake.nsi.in b/Utilities/Release/CMake.nsi.in index a41b0842d..0238e182a 100644 --- a/Utilities/Release/CMake.nsi.in +++ b/Utilities/Release/CMake.nsi.in @@ -23,7 +23,7 @@ ;Name and file Name "CMake ${VERSION}" - OutFile "cmake-${VERSION}.${PATCH}-win32.exe" + OutFile "@PROJECT_BINARY_DIR@\cmake-${VERSION}.${PATCH}-win32.exe" ;Default installation folder InstallDir "$PROGRAMFILES\CMake ${VERSION}" diff --git a/Utilities/Release/MakeRelease.cmake.in b/Utilities/Release/MakeRelease.cmake.in new file mode 100644 index 000000000..4718ac901 --- /dev/null +++ b/Utilities/Release/MakeRelease.cmake.in @@ -0,0 +1,42 @@ +# this script is designed to be run from a UNIX like shell under Windows +# and has some hard coded assumptions. Do not just randomly run this script +# without looking it over first. + +# Release version number. +SET (TAG + "CMake-@CMake_VERSION_MAJOR@-@CMake_VERSION_MINOR@-@CMake_VERSION_PATCH@") +SET (VERSION + "@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@.@CMake_VERSION_PATCH@") + +SET (SCPID "kitware@public.kitware.com") + +# CVSROOT setting used to check out CMake. +SET (CVSROOT ":pserver:anoncvs@www.cmake.org:/cvsroot/CMake") + +# build the NSI +EXEC_PROGRAM("@NSIS_MAKENSIS@" + ARGS "@PROJECT_BINARY_DIR@/Utilities/Release/@PROJECT_NAME@.nsi" +) + +# copy the NSI to the FTP site +EXEC_PROGRAM(scp + ARGS cmake-${VERSION}-win32.exe + ${SCPID}:/projects/FTP/pub/cmake/v@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@ + ) + +# tag the tree +EXEC_PROGRAM(cvs "@PROJECT_SOURCE_DIR@" + ARGS tag -F ${TAG}) + +# build the winzip src file and copy it over +EXEC_PROGRAM(rm C:/ + ARGS -rf @PROJECT_NAME@ +) +EXEC_PROGRAM(cvs C:/ + ARGS -d ${CVSROOT} export -r ${TAG} @PROJECT_NAME@) +EXEC_PROGRAM("@WINZIP_WZZIP@" "C:/@PROJECT_NAME@" + ARGS -r -P cmake-${VERSION}.zip) +EXEC_PROGRAM(scp "C:/@PROJECT_NAME@" + ARGS cmake-${VERSION}.zip + ${SCPID}:/projects/FTP/pub/cmake/v@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@ + ) diff --git a/Utilities/Release/Release.cmake b/Utilities/Release/Release.cmake index 7f7ca8620..dadec4563 100644 --- a/Utilities/Release/Release.cmake +++ b/Utilities/Release/Release.cmake @@ -50,12 +50,20 @@ IF(WIN32) ${PROJECT_SOURCE_DIR}/Utilities/Release/${PROJECT_NAME}.nsi.in ${PROJECT_BINARY_DIR}/Utilities/Release/${PROJECT_NAME}.nsi IMMEDIATE @ONLY) - CONFIGURE_FILE( - ${PROJECT_SOURCE_DIR}/Utilities/Release/Win32Release.sh.in - ${PROJECT_BINARY_DIR}/Utilities/Release/Win32Release.sh - IMMEDIATE @ONLY) CONFIGURE_FILE( ${PROJECT_SOURCE_DIR}/Utilities/Release/cmake_release.sh.in ${PROJECT_BINARY_DIR}/Utilities/Release/cmake_release.sh IMMEDIATE @ONLY) + CONFIGURE_FILE( + ${PROJECT_SOURCE_DIR}/Utilities/Release/MakeRelease.cmake.in + ${PROJECT_BINARY_DIR}/Utilities/Release/MakeRelease.cmake + IMMEDIATE @ONLY) ENDIF(WIN32) + +IF (NSIS_MAKENSIS AND WINZIP_WZZIP) + # build the NSI + ADD_CUSTOM_TARGET( release + ${CMAKE_COMMAND} -P + ${PROJECT_BINARY_DIR}/Utilities/Release/MakeRelease.cmake + ) +ENDIF (NSIS_MAKENSIS AND WINZIP_WZZIP) diff --git a/Utilities/Release/Win32Release.sh.in b/Utilities/Release/Win32Release.sh.in deleted file mode 100755 index a3bde3159..000000000 --- a/Utilities/Release/Win32Release.sh.in +++ /dev/null @@ -1,30 +0,0 @@ -# this script is designed to be run from a UNIX like shell under Windows -# and has some hard coded assumptions. Do not just randomly run this script -# without looking it over first. - -# Release version number. -TAG="CMake-@CMake_VERSION_MAJOR@-@CMake_VERSION_MINOR@-@CMake_VERSION_PATCH@" -VERSION="@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@.@CMake_VERSION_PATCH@" - -SCPID="kitware@public.kitware.com" - -# CVSROOT setting used to check out Cmake. -CVSROOT=":pserver:anoncvs@www.cmake.org:/cvsroot/CMake" - -# build the NSI -"@NSIS_MAKENSIS@" "@PROJECT_BINARY_DIR@/Utilities/Release/@PROJECT_NAME@.nsi" - -#scp cmake-${VERSION}-win32.exe ${SCPID}:/projects/FTP/pub/cmake/v@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@ - -# tag the tree -#cd "@PROJECT_SOURCE_DIR@" -#cvs tag -F ${TAG} - -# build the winzip src file -#cd C: -#rm -rf @PROJECT_NAME@ -#cvs -d ${CVSROOT} export -r ${TAG} @PROJECT_NAME@ - -#cd @PROJECT_NAME@ -#"@WINZIP_WZZIP@" -r -P cmake-${VERSION}.zip -#scp cmake-${VERSION}.zip ${SCPID}:/projects/FTP/pub/cmake/v@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@