2006-05-05 06:58:49 +04:00
|
|
|
#!/bin/sh
|
2006-05-09 20:23:19 +04:00
|
|
|
echo "Start release"
|
|
|
|
date
|
|
|
|
echo ""
|
2006-05-05 23:51:13 +04:00
|
|
|
echo "remove and create working directory @CMAKE_RELEASE_DIRECTORY@"
|
|
|
|
rm -rf @CMAKE_RELEASE_DIRECTORY@
|
|
|
|
mkdir @CMAKE_RELEASE_DIRECTORY@
|
2006-05-05 21:52:14 +04:00
|
|
|
|
2006-05-05 06:58:49 +04:00
|
|
|
check_exit_value()
|
|
|
|
{
|
|
|
|
VALUE="$1"
|
2006-05-05 20:14:32 +04:00
|
|
|
if [ "$VALUE" != "0" ]; then
|
2006-05-05 06:58:49 +04:00
|
|
|
echo "error in $2"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2006-05-05 21:52:14 +04:00
|
|
|
if [ ! -z "@CC@" ]; then
|
2006-05-05 22:53:50 +04:00
|
|
|
export CC="@CC@"
|
2006-05-05 21:52:14 +04:00
|
|
|
check_exit_value $? "set CC compiler env var" || exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -z "@CXX@" ]; then
|
2006-05-05 22:53:50 +04:00
|
|
|
export CXX="@CXX@"
|
2006-05-05 21:52:14 +04:00
|
|
|
check_exit_value $? "set CC compiler env var" || exit 1
|
|
|
|
fi
|
2006-05-09 21:48:36 +04:00
|
|
|
|
2006-05-05 21:52:14 +04:00
|
|
|
if [ ! -z "@LDFLAGS@" ]; then
|
2006-05-05 22:53:50 +04:00
|
|
|
export LDFLAGS="@LDFLAGS@"
|
2006-05-09 21:48:36 +04:00
|
|
|
check_exit_value $? "set LDFLAGS env var" || exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -z "@CFLAGS@" ]; then
|
|
|
|
export CFLAGS="@CFLAGS@"
|
|
|
|
check_exit_value $? "set CFLAGS env var" || exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -z "@CXXFLAGS@" ]; then
|
|
|
|
export CXXFLAGS="@CXXFLAGS@"
|
|
|
|
check_exit_value $? "setCXXFLAGS env var" || exit 1
|
2006-05-05 21:52:14 +04:00
|
|
|
fi
|
|
|
|
|
2006-05-05 20:14:32 +04:00
|
|
|
if [ ! -z "@USER_MAKE_RULE_FILE_CONTENTS@" ]; then
|
2006-05-05 06:58:49 +04:00
|
|
|
echo "@USER_MAKE_RULE_FILE_CONTENTS@" > "@USER_MAKE_RULE_FILE@"
|
|
|
|
check_exit_value $? "Create User Rule file" || exit 1
|
|
|
|
fi
|
|
|
|
echo "Create a directory to build in"
|
2006-05-05 23:51:13 +04:00
|
|
|
rm -rf @CMAKE_RELEASE_DIRECTORY@/@CMAKE_VERSION@-build
|
2006-05-05 06:58:49 +04:00
|
|
|
check_exit_value $? "Remove build tree" || exit 1
|
2006-05-05 23:51:13 +04:00
|
|
|
mkdir @CMAKE_RELEASE_DIRECTORY@/@CMAKE_VERSION@-build
|
2006-05-05 06:58:49 +04:00
|
|
|
check_exit_value $? "Create build directory" || exit 1
|
|
|
|
# make sure directory was created
|
2006-05-05 23:51:13 +04:00
|
|
|
if [ ! -d @CMAKE_RELEASE_DIRECTORY@/@CMAKE_VERSION@-build ]; then
|
|
|
|
echo "Could not create @CMAKE_RELEASE_DIRECTORY@/@CMAKE_VERSION@-build"
|
2006-05-05 06:58:49 +04:00
|
|
|
exit -1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Create initial cache"
|
2006-05-05 23:51:13 +04:00
|
|
|
echo "@INITIAL_CACHE@" > @CMAKE_RELEASE_DIRECTORY@/@CMAKE_VERSION@-build/CMakeCache.txt
|
2006-05-05 06:58:49 +04:00
|
|
|
check_exit_value $? "Create initial cache" || exit 1
|
|
|
|
|
|
|
|
#echo "Login into cvs."
|
2006-05-05 20:14:32 +04:00
|
|
|
#echo "cmake" | @CVS_COMMAND@ -d @CVSROOT@ login
|
2006-05-05 06:58:49 +04:00
|
|
|
|
|
|
|
echo "Checkout the source for @CMAKE_VERSION@"
|
2006-05-05 23:51:13 +04:00
|
|
|
cd @CMAKE_RELEASE_DIRECTORY@
|
2006-05-05 20:14:32 +04:00
|
|
|
@CMAKE_CHECKOUT@ -d @CMAKE_VERSION@ CMake
|
2006-05-05 06:58:49 +04:00
|
|
|
check_exit_value $? "Checkout cmake source" || exit 1
|
|
|
|
|
2006-05-05 23:51:13 +04:00
|
|
|
cd @CMAKE_RELEASE_DIRECTORY@/@CMAKE_VERSION@-build
|
2006-05-10 22:03:51 +04:00
|
|
|
|
|
|
|
if [ ! -z "@CONFIGURE_WITH_CMAKE@" ]; then
|
|
|
|
echo "Run cmake to configure cmake"
|
|
|
|
@CMAKE_CONFIGURE_PATH@ ../@CMAKE_VERSION@
|
|
|
|
check_exit_value $? "Configure cmake" || exit 1
|
|
|
|
else
|
|
|
|
echo "Run cmake bootstrap --parallel=@PROCESSORS@"
|
|
|
|
../@CMAKE_VERSION@/bootstrap --parallel=@PROCESSORS@
|
|
|
|
check_exit_value $? "Bootstrap cmake" || exit 1
|
|
|
|
fi
|
2006-05-05 06:58:49 +04:00
|
|
|
|
2006-05-05 20:34:26 +04:00
|
|
|
echo "Build cmake with @MAKE@"
|
2006-05-05 06:58:49 +04:00
|
|
|
@MAKE@
|
|
|
|
check_exit_value $? "Build cmake" || exit 1
|
|
|
|
|
2006-05-09 00:36:51 +04:00
|
|
|
if [ -z "@SKIP_TESTS@" ]; then
|
|
|
|
echo "Run cmake tests"
|
|
|
|
@MAKE@ test
|
|
|
|
check_exit_value $? "Test cmake" || exit 1
|
|
|
|
fi
|
2006-05-05 06:58:49 +04:00
|
|
|
|
2006-05-12 00:07:42 +04:00
|
|
|
# loop over binary generators
|
|
|
|
generators="@CPACK_BINARY_GENERATORS@"
|
|
|
|
for GEN in $generators; do
|
|
|
|
echo "Create $GEN package"
|
|
|
|
./bin/cpack -D CMAKE_MAKE_PROGRAM=@MAKE_PROGRAM@ -G $GEN
|
|
|
|
check_exit_value $? "Create $GEN package" || exit 1
|
|
|
|
done
|
|
|
|
|
|
|
|
# loop over source generators
|
|
|
|
generators="@CPACK_SOURCE_GENERATORS@"
|
|
|
|
for GEN in $generators; do
|
|
|
|
echo "Create $GEN package"
|
|
|
|
./bin/cpack -D CMAKE_MAKE_PROGRAM=@MAKE_PROGRAM@ -G $GEN --config CPackSourceConfig.cmake
|
|
|
|
check_exit_value $? "Create $GEN package" || exit 1
|
|
|
|
done
|
|
|
|
|
2006-05-05 06:58:49 +04:00
|
|
|
|
2006-05-05 20:25:28 +04:00
|
|
|
|
2006-05-06 06:04:55 +04:00
|
|
|
# need to add an extra copy thing here
|
|
|
|
if [ ! -z "@EXTRA_COPY@" ]; then
|
|
|
|
@EXTRA_COPY@
|
|
|
|
check_exit_value $? "Extra copy step @EXTRA_COPY@" || exit 1
|
|
|
|
fi
|
2006-05-09 20:23:19 +04:00
|
|
|
echo "End release"
|
|
|
|
date
|
|
|
|
echo ""
|
2006-05-05 20:25:28 +04:00
|
|
|
exit 0
|