cmake_release_unix_config.sh 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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 " PLATFORM=\"x86-linux\""
  16. exit 1
  17. fi
  18. # Set some defaults here. They can be changed by the configuration
  19. # file.
  20. CVSROOT=":pserver:[email protected]:/cvsroot/CMake"
  21. CAT="cat"
  22. COMPRESS="compress"
  23. CREATE_SOURCE_TARBALL="no"
  24. CVS="cvs"
  25. FIND="find"
  26. GZIP="gzip"
  27. MAKE="make"
  28. MKDIR="mkdir"
  29. RELEASE_ROOT=`pwd`
  30. STRIP="strip"
  31. TAR="tar"
  32. TOUCH="touch"
  33. CC="gcc"
  34. CXX="c++"
  35. CFLAGS=""
  36. CXXFLAGS=""
  37. PREFIX="/usr/local"
  38. INSTALL_SUBDIRS="bin share doc"
  39. DOC_DIR="/doc/cmake"
  40. # Functions can be replaced by configuration file.
  41. # Create extra files in the installation tree. This allows
  42. # configurations to add documentation.
  43. CreateExtraFiles()
  44. {
  45. return 0
  46. }
  47. # Create a package file. This allows configurations to create
  48. # packages for certain UNIX distributions.
  49. CreatePackage()
  50. {
  51. return 0
  52. }
  53. # Write entries into the cache file before building cmake.
  54. WriteCMakeCache()
  55. {
  56. ${CAT} > CMakeCache.txt <<EOF
  57. BUILD_TESTING:BOOL=OFF
  58. EOF
  59. }
  60. SELFPATH=`cd \`echo $0 | sed -n '/\//{s/\/[^\/]*$//;p;}'\`;pwd`
  61. . ${SELFPATH}/cmake_release_version.sh
  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. RELEASE_TAG="${CURRENT_TAG}"
  73. VERSION="${CURRENT_VERSION}"
  74. INSTALL_DIR="${RELEASE_ROOT}/Install"
  75. TARBALL_DIR="${RELEASE_ROOT}/Tarballs"
  76. SOURCE_DIR="${RELEASE_ROOT}/CMake-$VERSION"
  77. BUILD_DIR="${RELEASE_ROOT}/CMake-$VERSION-$PLATFORM-build"
  78. LOG_DIR="${RELEASE_ROOT}/Logs"
  79. INSTALL_OPTIONS="DESTDIR=\"${INSTALL_DIR}\""
  80. if [ -z "$SOURCE_TARBALL_NAME" ]; then
  81. SOURCE_TARBALL_NAME="CMake$VERSION-src-unix"
  82. fi