CMakeLists.txt
changeset 20 0ce7093df25f
parent 7 5db1448eb857
child 22 1a1bc121fe90
equal deleted inserted replaced
19:d775d7289fe4 20:0ce7093df25f
       
     1 ## Copyright 2009 Myhailo Danylenko
       
     2 # This file is part of lua-lm
       
     3 #
       
     4 # lua-lm is free software: you can redistribute it and/or modify
       
     5 # it under the terms of the GNU General Public License as published by
       
     6 # the Free Software Foundation, either version 2 of the License, or
       
     7 # (at your option) any later version.
       
     8 #
       
     9 # This program is distributed in the hope that it will be useful,
       
    10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    12 # GNU General Public License for more details.
       
    13 #
       
    14 # You should have received a copy of the GNU General Public License
       
    15 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
     1 
    16 
     2 cmake_minimum_required(VERSION 2.6)
    17 cmake_minimum_required(VERSION 2.6)
     3 project(lua-lm C)
    18 project(lua-lm C)
     4 
    19 
     5 ## User options
    20 ## User options
    20 set(CPACK_PACKAGE_DESCRIPTION_FILE ${lua-lm_SOURCE_DIR}/README)
    35 set(CPACK_PACKAGE_DESCRIPTION_FILE ${lua-lm_SOURCE_DIR}/README)
    21 set(CPACK_RESOURCE_FILE_LICENSE ${lua-lm_SOURCE_DIR}/COPYING)
    36 set(CPACK_RESOURCE_FILE_LICENSE ${lua-lm_SOURCE_DIR}/COPYING)
    22 set(CPACK_RESOURCE_FILE_README ${lua-lm_SOURCE_DIR}/README)
    37 set(CPACK_RESOURCE_FILE_README ${lua-lm_SOURCE_DIR}/README)
    23 set(CPACK_RESOURCE_FILE_WELCOME ${lua-lm_SOURCE_DIR}/README)
    38 set(CPACK_RESOURCE_FILE_WELCOME ${lua-lm_SOURCE_DIR}/README)
    24 set(CPACK_DEBIAN_PACKAGE_SECTION libs)
    39 set(CPACK_DEBIAN_PACKAGE_SECTION libs)
       
    40 # XXX: tmp=`tempfile`; obj=${lua-lm_BINARY_DIR}/loudmouth.so; ldd $obj > $tmp; objdump -p $obj | \grep NEEDED | sed -e 's/.*NEEDED *//' | xargs -I "{}" grep -F "{}" $tmp | sed -e 's/.*=> *\(\S*\).*/\1/' | xargs dpkg -S | cut -d : -f 1 | sort -u ; \rm $tmp
       
    41 # TODO: versions
       
    42 set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6, libglib2.0-0, liblua5.1-0, libloudmouth1-0")
    25 set(CPACK_SOURCE_GENERATOR TBZ2)
    43 set(CPACK_SOURCE_GENERATOR TBZ2)
    26 set(CPACK_GENERATOR DEB)
    44 set(CPACK_GENERATOR DEB CACHE TEXT "Binary package generator, eg DEB, RPM, TGZ, NSIS...")
    27 # FIXME: Detect architecture. How? Though, it anyway produces nonconformant deb names...
    45 # FIXME: Detect architecture. How? Though, it anyway produces nonconformant deb names...
    28 set(CPACK_SYSTEM_NAME i386)
    46 set(CPACK_SYSTEM_NAME i386)
    29 # XXX: Set package name directly to get rid of -Sources?
    47 # XXX: Set package name directly to get rid of -Sources?
    30 set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*;\\\\.swp;~$;/build/;\\\\.tar\\\\.;\\\\.deb;\\\\.so")
    48 set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*;\\\\.swp;~$;/build/;\\\\.tar\\\\.;\\\\.deb;\\\\.so")
    31 include(CPack)
    49 include(CPack)