1
0

cmake_release_unix_config.sh 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #!/bin/sh
  2. #
  3. # CMake UNIX Release Configuration Script.
  4. #
  5. # This is sourced by the cmake_release_unix_build and
  6. # cmake_release_unix_package to setup the configuration.
  7. #
  8. # Check the command line arguments.
  9. CONFIG_FILE=$1
  10. if test "x$1" = "x"; then
  11. echo "Usage:"
  12. echo " $0 <configuration-file>"
  13. echo ""
  14. echo "Sample configuration file:"
  15. echo " RELEASE_TAG=\"Release-1-4\""
  16. echo " VERSION=\"1.4\""
  17. echo " PLATFORM=\"x86-linux\""
  18. exit 1
  19. fi
  20. # Set some defaults here. They can be changed by the configuration
  21. # file.
  22. CVSROOT=":pserver:[email protected]:/cvsroot/CMake"
  23. CAT="cat"
  24. COMPRESS="compress"
  25. CREATE_SOURCE_TARBALL="no"
  26. CVS="cvs"
  27. FIND="find"
  28. GZIP="gzip"
  29. MAKE="make"
  30. MKDIR="mkdir"
  31. RELEASE_ROOT=`pwd`
  32. STRIP="strip"
  33. TAR="tar"
  34. TOUCH="touch"
  35. CC="gcc"
  36. CXX="c++"
  37. CFLAGS=""
  38. CXXFLAGS=""
  39. PREFIX="/usr/local"
  40. INSTALL_SUBDIRS="bin share doc"
  41. DOC_DIR="/doc/cmake"
  42. # Functions can be replaced by configuration file.
  43. # Create extra files in the installation tree. This allows
  44. # configurations to add documentation.
  45. CreateExtraFiles()
  46. {
  47. return 0
  48. }
  49. # Create a package file. This allows configurations to create
  50. # packages for certain UNIX distributions.
  51. CreatePackage()
  52. {
  53. return 0
  54. }
  55. # Write entries into the cache file before building cmake.
  56. WriteCMakeCache()
  57. {
  58. ${CAT} > CMakeCache.txt <<EOF
  59. BUILD_TESTING:BOOL=OFF
  60. EOF
  61. }
  62. #-----------------------------------------------------------------------------
  63. # Configuration options.
  64. echo "Reading configuration from ${CONFIG_FILE}..."
  65. if . ${CONFIG_FILE} ; then : ; else
  66. echo "Error reading configuration."
  67. exit 1
  68. fi
  69. #-----------------------------------------------------------------------------
  70. export CC CXX CFLAGS CXXFLAGS
  71. # Select directories.
  72. INSTALL_DIR="${RELEASE_ROOT}/Install"
  73. TARBALL_DIR="${RELEASE_ROOT}/Tarballs"
  74. SOURCE_DIR="${RELEASE_ROOT}/CMake-$VERSION"
  75. BUILD_DIR="${RELEASE_ROOT}/CMake-$VERSION-$PLATFORM-build"
  76. LOG_DIR="${RELEASE_ROOT}/Logs"
  77. INSTALL_OPTIONS="DESTDIR=\"${INSTALL_DIR}\""
  78. if [ -z "$SOURCE_TARBALL_NAME" ]; then
  79. SOURCE_TARBALL_NAME="CMake$VERSION-src-unix"
  80. fi