2 # vim: expandtab sw=4 ts=4 sts=4:
3 # Wrapper for cmake to keep minimal compatibility with auto*
5 # Exit on error and undefined variables
9 Wrapper script for configuring CMake for Gammu.
11 This provides limited compatibility with configure, if you want full
12 configuration control, use directly CMake. More information about CMake
13 is available at <http://www.cmake.org>.
17 if ! type cmake
> /dev
/null
2>&1 ; then
18 echo 'ERROR: CMake not found, please install it, it is required for build.'
24 Usage: ./configure [options]
26 --help|-h shows this help
27 --prefix=<path> installation prefix
28 --enable-shared enables shared build
29 --enable-debug enables debug build
30 --enable-tiger enables Mac OS X 10.4 (Tiger) build
31 --enable-backup enable backup support
32 --enable-win32 enable mingw crosscomilation
33 --enable-protection enable compile time protections
34 --with-python=<path> path to Python interpreter
35 --without-gnapplet disable installation of gnapplet
37 All enable params have their disable counterparts.
43 # directory where we will build
44 BUILD_DIR
=build-configure
46 # directory where sources are located
60 # process command line
61 while [ "$#" -gt 0 ] ; do
67 CMAKE_PREFIX
="-DCMAKE_INSTALL_PREFIX=${1##--prefix=}"
70 CMAKE_PYTHON
="-DBUILD_PYTHON=${1##--with-python=}"
73 CMAKE_BACKUP
="-DWITH_BACKUP=ON"
76 CMAKE_BACKUP
="-DWITH_BACKUP=OFF"
79 CMAKE_CROSS
="-DCROSS_MINGW=ON"
82 CMAKE_CROSS
="-DCROSS_MINGW=OFF"
85 CMAKE_SHARED
="-DBUILD_SHARED_LIBS=ON"
88 CMAKE_SHARED
="-DBUILD_SHARED_LIBS=OFF"
91 CMAKE_PROTECTION
="-DENABLE_PROTECTION=ON"
94 CMAKE_PROTECTION
="-DENABLE_PROTECTION=OFF"
97 CMAKE_DEBUG
="-DCMAKE_BUILD_TYPE=Debug"
103 CMAKE_GNAP
="-DINSTALL_GNAPPLET=OFF"
106 CMAKE_TIGER
="-DENABLE_TIGER=ON"
110 --disable-dependency-tracking)
112 --disable-maintainer-mode)
127 echo "Unknown parameter: $1"
135 # create build dir if needed
136 if [ ! -d "$BUILD_DIR" ] ; then
137 mkdir
-p "$BUILD_DIR"
143 # invoke cmake to do configuration
144 cmake
$SOURCE_DIR $CMAKE_PREFIX $CMAKE_SHARED $CMAKE_DEBUG $CMAKE_BACKUP $CMAKE_CROSS $CMAKE_PROTECTION $CMAKE_PYTHON $CMAKE_GNAP $CMAKE_TIGER