CMake/Utilities/Release/release_cmake.sh.in

79 lines
2.1 KiB
Bash
Raw Normal View History

2006-05-05 06:58:49 +04:00
#!/bin/sh
echo "remove and create working directory ~/CMakeReleaseDirectory"
rm -rf ~/CMakeReleaseDirectory
mkdir ~/CMakeReleaseDirectory
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
}
if [ ! -z "@CC@" ]; then
set CC="@CC@"
check_exit_value $? "set CC compiler env var" || exit 1
fi
if [ ! -z "@CXX@" ]; then
set CXX="@CXX@"
check_exit_value $? "set CC compiler env var" || exit 1
fi
if [ ! -z "@LDFLAGS@" ]; then
set LDFLAGS="@LDFLAGS@"
check_exit_value $? "set CC compiler env var" || exit 1
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"
rm -rf ~/CMakeReleaseDirectory/@CMAKE_VERSION@-build
check_exit_value $? "Remove build tree" || exit 1
mkdir ~/CMakeReleaseDirectory/@CMAKE_VERSION@-build
check_exit_value $? "Create build directory" || exit 1
# make sure directory was created
2006-05-05 20:14:32 +04:00
if [ ! -d ~/CMakeReleaseDirectory/@CMAKE_VERSION@-build ]; then
2006-05-05 06:58:49 +04:00
echo "Could not create ~/CMakeReleaseDirectory/@CMAKE_VERSION@-build"
exit -1
fi
echo "Create initial cache"
2006-05-05 20:14:32 +04:00
echo "@INITIAL_CACHE@" > ~/CMakeReleaseDirectory/@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@"
cd ~/CMakeReleaseDirectory
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
cd ~/CMakeReleaseDirectory/@CMAKE_VERSION@-build
echo "Run cmake bootstrap --parallel=@PROCESSORS@"
2006-05-05 20:14:32 +04:00
../@CMAKE_VERSION@/bootstrap --parallel=@PROCESSORS@
2006-05-05 06:58:49 +04:00
check_exit_value $? "Bootstrap cmake" || exit 1
echo "Build cmake with @MAKE@"
2006-05-05 06:58:49 +04:00
@MAKE@
check_exit_value $? "Build cmake" || exit 1
echo "Run cmake tests"
@MAKE@ test
check_exit_value $? "Test cmake" || exit 1
echo "Run package"
@MAKE@ package
check_exit_value $? "Package cmake" || exit 1
echo "Create Tar.gz"
./bin/cpack -G TGZ
check_exit_value $? "Create TGZ" || exit 1
2006-05-05 20:25:28 +04:00
exit 0