CMakeLists.txt
author Myhailo Danylenko <isbear@ukrpost.net>
Sat, 05 Dec 2009 22:32:55 +0200
changeset 0 1c4eb7aed6c2
child 1 9eb794ebef85
permissions -rw-r--r--
Initial commit
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     1
## Copyright 2009 Myhailo Danylenko
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     2
# This file is part of mcabber module writing howto examples.
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     3
#
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     4
# Examples are free software: you can redistribute it and/or modify
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     5
# it under the terms of the GNU General Public License as published by
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     6
# the Free Software Foundation, either version 2 of the License, or
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     7
# (at your option) any later version.
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     8
#
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     9
# This program is distributed in the hope that it will be useful,
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    12
# GNU General Public License for more details.
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    13
#
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    14
# You should have received a copy of the GNU General Public License
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    16
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    17
cmake_minimum_required(VERSION 2.6) 
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    18
project(templatecmd C) 
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    19
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    20
## Target definitions
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    21
add_library(templatecmd MODULE templatecmd.c) 
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    22
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    23
## User settable options
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    24
set(MCABBER_INCLUDE_DIR "${templatecmd_SOURCE_DIR}/../include" 
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    25
    CACHE FILEPATH "Path to mcabber headers") 
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    26
 
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    27
## Packaging information
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    28
set(CPACK_PACKAGE_NAME libmcabber-templatecmd)
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    29
set(CPACK_PACKAGE_VERSION "0.0.1")
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    30
set(CPACK_PACKAGE_VENDOR "IsBear")
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    31
set(CPACK_PACKAGE_CONTACT "Myhailo Danylenko <isbear@ukrpost.net>")
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    32
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Temlate commands for mcabber")
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    33
set(CPACK_RESOURCE_FILE_LICENSE ${templatecmd_SOURCE_DIR}/COPYING)
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    34
set(CPACK_SOURCE_GENERATOR TBZ2)
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    35
set(CPACK_GENERATOR DEB CACHE TEXT "Binary package generator, eg DEB, RPM, TGZ, NSIS...")
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    36
set(CPACK_DEBIAN_PACKAGE_SECTION libs)
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    37
find_program(DPKG_EXECUTABLE dpkg)
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    38
if(DPKG_EXECUTABLE)
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    39
	execute_process(COMMAND ${DPKG_EXECUTABLE} --print-architecture OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE)
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    40
else()
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    41
	set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386 CACHE TEXT "Architecture of package")
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    42
endif()
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    43
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    44
set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*;\\\\.swp;~$;/build/;\\\\.tar\\\\.;\\\\.deb;\\\\.so")
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    45
include(CPack)
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    46
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    47
## Check for build dependencies
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    48
find_package(PkgConfig REQUIRED) 
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    49
pkg_check_modules(GLIB REQUIRED glib-2.0) 
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    50
pkg_check_modules(GMODULE REQUIRED gmodule-2.0) 
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    51
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    52
## Compiler setup
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    53
include_directories(SYSTEM ${GLIB_INCLUDE_DIRS} 
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    54
                    ${GMODULE_INCLUDE_DIRS}) 
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    55
target_link_libraries(templatecmd ${GLIB_LIBRARIES} 
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    56
                      ${GMODULE_LIBRARIES}) 
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    57
include_directories(${templatecmd_SOURCE_DIR} 
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    58
                    ${templatecmd_BINARY_DIR} 
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    59
                    ${MCABBER_INCLUDE_DIR}) 
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    60
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    61
## Installation
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    62
install(TARGETS templatecmd DESTINATION lib/mcabber) 
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    63
install(FILES templatecmd.rc TODO README COPYING DESTINATION share/doc/${CPACK_PACKAGE_NAME})
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    64
install(DIRECTORY help DESTINATION share/mcabber)
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    65
1c4eb7aed6c2 Initial commit
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    66
## The End ## vim: se ts=4: ##