release_cmake.sh.in 2.91 KB
Newer Older
Bill Hoffman's avatar
Bill Hoffman committed
1
#!/bin/sh
Bill Hoffman's avatar
Bill Hoffman committed
2
3
4
echo "Start release"
date
echo ""
5
6
7
echo  "remove and create working directory @CMAKE_RELEASE_DIRECTORY@"
rm -rf @CMAKE_RELEASE_DIRECTORY@ 
mkdir @CMAKE_RELEASE_DIRECTORY@
8

Bill Hoffman's avatar
Bill Hoffman committed
9
10
11
check_exit_value()
{
   VALUE="$1"
Bill Hoffman's avatar
Bill Hoffman committed
12
   if [ "$VALUE" != "0" ]; then
Bill Hoffman's avatar
Bill Hoffman committed
13
14
15
16
17
    echo "error in $2"
    exit 1
   fi      
}

18
if [ ! -z "@CC@" ]; then
Andy Cedilnik's avatar
Andy Cedilnik committed
19
    export CC="@CC@"
20
21
22
23
    check_exit_value $? "set CC compiler env var" || exit 1
fi

if [ ! -z "@CXX@" ]; then
Andy Cedilnik's avatar
Andy Cedilnik committed
24
    export CXX="@CXX@"
25
26
    check_exit_value $? "set CC compiler env var" || exit 1
fi
Bill Hoffman's avatar
Bill Hoffman committed
27

28
if [ ! -z "@LDFLAGS@" ]; then
Andy Cedilnik's avatar
Andy Cedilnik committed
29
    export LDFLAGS="@LDFLAGS@"
Bill Hoffman's avatar
Bill Hoffman committed
30
31
32
33
34
35
36
37
38
39
40
    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
41
42
fi

Bill Hoffman's avatar
Bill Hoffman committed
43
if [ ! -z "@USER_MAKE_RULE_FILE_CONTENTS@" ]; then
Bill Hoffman's avatar
Bill Hoffman committed
44
45
46
47
    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"
48
rm -rf @CMAKE_RELEASE_DIRECTORY@/@CMAKE_VERSION@-build
Bill Hoffman's avatar
Bill Hoffman committed
49
check_exit_value $? "Remove build tree" || exit 1
50
mkdir @CMAKE_RELEASE_DIRECTORY@/@CMAKE_VERSION@-build
Bill Hoffman's avatar
Bill Hoffman committed
51
52
check_exit_value $? "Create build directory" || exit 1
# make sure directory was created
53
54
if [ ! -d @CMAKE_RELEASE_DIRECTORY@/@CMAKE_VERSION@-build ]; then
        echo "Could not create @CMAKE_RELEASE_DIRECTORY@/@CMAKE_VERSION@-build"
Bill Hoffman's avatar
Bill Hoffman committed
55
56
57
58
        exit -1
fi

echo "Create initial cache"
59
echo "@INITIAL_CACHE@" > @CMAKE_RELEASE_DIRECTORY@/@CMAKE_VERSION@-build/CMakeCache.txt
Bill Hoffman's avatar
Bill Hoffman committed
60
61
62
check_exit_value $? "Create initial cache" || exit 1

#echo "Login into cvs."
Bill Hoffman's avatar
Bill Hoffman committed
63
#echo "cmake" | @CVS_COMMAND@ -d @CVSROOT@ login
Bill Hoffman's avatar
Bill Hoffman committed
64
65

echo "Checkout the source for @CMAKE_VERSION@"
66
cd @CMAKE_RELEASE_DIRECTORY@ 
Bill Hoffman's avatar
Bill Hoffman committed
67
@CMAKE_CHECKOUT@ -d @CMAKE_VERSION@ CMake
Bill Hoffman's avatar
Bill Hoffman committed
68
69
check_exit_value $? "Checkout cmake source" || exit 1

70
cd @CMAKE_RELEASE_DIRECTORY@/@CMAKE_VERSION@-build 
Bill Hoffman's avatar
ENH:    
Bill Hoffman committed
71
72
73
74
75
76
77
78
79
80

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
Bill Hoffman's avatar
Bill Hoffman committed
81

82
echo "Build cmake with @MAKE@"
Bill Hoffman's avatar
Bill Hoffman committed
83
84
85
@MAKE@
check_exit_value $? "Build cmake" || exit 1

Bill Hoffman's avatar
Bill Hoffman committed
86
87
88
89
90
if [ -z "@SKIP_TESTS@" ]; then
    echo "Run cmake tests"
    @MAKE@ test
    check_exit_value $? "Test cmake" || exit 1
fi
Bill Hoffman's avatar
Bill Hoffman committed
91
92

echo "Run package"
Bill Hoffman's avatar
Bill Hoffman committed
93
./bin/cpack -D CMAKE_MAKE_PROGRAM=@MAKE_PROGRAM@
Bill Hoffman's avatar
Bill Hoffman committed
94
95
96
check_exit_value $? "Package cmake" || exit 1

echo "Create Tar.gz"
Bill Hoffman's avatar
Bill Hoffman committed
97
./bin/cpack  -D CMAKE_MAKE_PROGRAM=@MAKE_PROGRAM@ -G TGZ
Bill Hoffman's avatar
Bill Hoffman committed
98
check_exit_value $? "Create TGZ" || exit 1
Bill Hoffman's avatar
Bill Hoffman committed
99

Bill Hoffman's avatar
Bill Hoffman committed
100
101
102
103
104
# 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
Bill Hoffman's avatar
Bill Hoffman committed
105
106
107
echo "End release"
date
echo ""
Bill Hoffman's avatar
Bill Hoffman committed
108
exit 0