author | Myhailo Danylenko <isbear@ukrpost.net> |
Thu, 04 Mar 2010 19:50:39 +0200 | |
changeset 15 | 891fc0779d50 |
parent 14 | 706e77af2947 |
child 16 | 19d13d97b3a1 |
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(cmd C) |
|
19 |
||
10
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
20 |
## User settable options |
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
21 |
|
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
22 |
## Check for build dependencies |
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
23 |
find_package(PkgConfig REQUIRED) |
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
24 |
pkg_check_modules(GLIB REQUIRED glib-2.0) |
13
88315b883803
Use pkg-config to detect mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
25 |
pkg_check_modules(MCABBER REQUIRED mcabber) |
10
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
26 |
link_directories(${GLIB_LIBRARY_DIRS} |
13
88315b883803
Use pkg-config to detect mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
27 |
${MCABBER_LIBRARY_DIRS}) |
10
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
28 |
|
0 | 29 |
## Target definitions |
30 |
add_library(cmd MODULE cmd.c) |
|
31 |
||
10
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
32 |
## Compiler setup |
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
33 |
include_directories(SYSTEM ${GLIB_INCLUDE_DIRS} |
13
88315b883803
Use pkg-config to detect mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
34 |
${MCABBER_INCLUDE_DIRS}) |
10
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
35 |
target_link_libraries(cmd ${GLIB_LIBRARIES} |
13
88315b883803
Use pkg-config to detect mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
12
diff
changeset
|
36 |
${MCABBER_LIBRARIES}) |
10
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
37 |
include_directories(${cmd_SOURCE_DIR} |
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
38 |
${cmd_BINARY_DIR}) |
aaaa2b1a8de0
Fix linker library search path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
9
diff
changeset
|
39 |
|
0 | 40 |
## Packaging information |
41 |
set(CPACK_PACKAGE_NAME libmcabber-cmd) |
|
42 |
set(CPACK_PACKAGE_VERSION "0.0.1") |
|
43 |
set(CPACK_PACKAGE_VENDOR "IsBear") |
|
44 |
set(CPACK_PACKAGE_CONTACT "Myhailo Danylenko <isbear@ukrpost.net>") |
|
8
5771827a4976
Change mcabber headers naming convention
Myhailo Danylenko <isbear@ukrpost.net>
parents:
2
diff
changeset
|
45 |
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Mcabber module for sending shell commands output to others") |
0 | 46 |
set(CPACK_RESOURCE_FILE_LICENSE ${cmd_SOURCE_DIR}/COPYING) |
47 |
set(CPACK_SOURCE_GENERATOR TBZ2) |
|
48 |
set(CPACK_GENERATOR DEB CACHE TEXT "Binary package generator, eg DEB, RPM, TGZ, NSIS...") |
|
49 |
set(CPACK_DEBIAN_PACKAGE_SECTION libs) |
|
50 |
find_program(DPKG_EXECUTABLE dpkg) |
|
51 |
if(DPKG_EXECUTABLE) |
|
52 |
execute_process(COMMAND ${DPKG_EXECUTABLE} --print-architecture OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE) |
|
53 |
else() |
|
54 |
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386 CACHE TEXT "Architecture of package") |
|
55 |
endif() |
|
56 |
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}") |
|
57 |
set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*;\\\\.swp;~$;/build/;\\\\.tar\\\\.;\\\\.deb;\\\\.so") |
|
58 |
include(CPack) |
|
59 |
||
12
bc6d4169afdb
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
60 |
## Installation |
bc6d4169afdb
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
61 |
install(TARGETS cmd DESTINATION lib/mcabber) |
bc6d4169afdb
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
62 |
install(FILES cmd.rc COPYING README DESTINATION share/doc/${CPACK_PACKAGE_NAME}) |
bc6d4169afdb
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
63 |
install(DIRECTORY help DESTINATION share/mcabber) |
bc6d4169afdb
Fix documentation installation path
Myhailo Danylenko <isbear@ukrpost.net>
parents:
11
diff
changeset
|
64 |
|
0 | 65 |
## The End ## vim: se ts=4: ## |