author | Mikael Berthe <mikael@lilotux.net> |
Sun, 14 Nov 2010 11:02:15 +0100 | |
changeset 9 | c1f0277182a3 |
parent 2 | 88890ebee9e3 |
child 12 | b88ea7f650f1 |
permissions | -rw-r--r-- |
0 | 1 |
## Copyright 2009 Myhailo Danylenko |
2 |
# This file is part of mcabber module writing howto examples. |
|
3 |
# |
|
4 |
# Examples are 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/>. |
|
16 |
||
17 |
cmake_minimum_required(VERSION 2.6) |
|
18 |
project(uptime C) |
|
19 |
set(PROJECT_VERSION "0.0.1") |
|
20 |
||
21 |
## User settable options |
|
22 |
||
23 |
## Check for build dependencies |
|
24 |
find_package(PkgConfig REQUIRED) |
|
25 |
pkg_check_modules(GLIB REQUIRED glib-2.0) |
|
26 |
pkg_check_modules(MCABBER REQUIRED mcabber) |
|
27 |
link_directories(${GLIB_LIBRARY_DIRS} |
|
28 |
${MCABBER_LIBRARY_DIRS}) |
|
29 |
||
30 |
## Target definitions |
|
31 |
add_library(uptime MODULE uptime.c) |
|
32 |
||
33 |
## Compiler setup |
|
34 |
configure_file(config.h.in config.h) |
|
35 |
include_directories(SYSTEM ${GLIB_INCLUDE_DIRS} |
|
36 |
${MCABBER_INCLUDE_DIRS}) |
|
37 |
target_link_libraries(uptime ${GLIB_LIBRARIES} |
|
38 |
${MCABBER_LIBRARIES}) |
|
39 |
include_directories(${uptime_SOURCE_DIR} |
|
40 |
${uptime_BINARY_DIR}) |
|
41 |
set_target_properties(uptime PROPERTIES COMPILE_FLAGS "-Wall") |
|
42 |
||
43 |
## Packaging information |
|
44 |
set(CPACK_PACKAGE_NAME libmcabber-uptime) |
|
45 |
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) |
|
46 |
set(CPACK_PACKAGE_VENDOR "IsBear") |
|
47 |
set(CPACK_PACKAGE_CONTACT "Myhailo Danylenko <isbear@ukrpost.net>") |
|
2
88890ebee9e3
Update package description
Myhailo Danylenko <isbear@ukrpost.net>
parents:
0
diff
changeset
|
48 |
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Mcabber module to show program uptime") |
0 | 49 |
set(CPACK_RESOURCE_FILE_LICENSE ${uptime_SOURCE_DIR}/COPYING) |
50 |
set(CPACK_SOURCE_GENERATOR TBZ2) |
|
51 |
set(CPACK_GENERATOR DEB CACHE TEXT "Binary package generator, eg DEB, RPM, TGZ, NSIS...") |
|
52 |
set(CPACK_DEBIAN_PACKAGE_SECTION libs) |
|
53 |
find_program(DPKG_EXECUTABLE dpkg) |
|
54 |
if(DPKG_EXECUTABLE) |
|
55 |
execute_process(COMMAND ${DPKG_EXECUTABLE} --print-architecture OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE) |
|
56 |
else() |
|
57 |
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386 CACHE TEXT "Architecture of package") |
|
58 |
endif() |
|
59 |
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}") |
|
60 |
set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*;\\\\.swp;~$;/build/;\\\\.tar\\\\.;\\\\.deb;\\\\.so") |
|
61 |
include(CPack) |
|
62 |
||
63 |
## Installation |
|
64 |
install(TARGETS uptime DESTINATION lib/mcabber) |
|
65 |
install(FILES uptime.rc COPYING README DESTINATION share/doc/${CPACK_PACKAGE_NAME}) |
|
66 |
install(DIRECTORY help DESTINATION share/mcabber) |
|
67 |
||
68 |
## The End ## vim: se ts=4: ## |